@karakuri-ui/react 0.3.9 → 0.3.11

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.
Files changed (79) hide show
  1. package/dist/components/ui/accordion.d.mts +1 -1
  2. package/dist/components/ui/accordion.d.ts +1 -1
  3. package/dist/components/ui/alert.d.mts +2 -2
  4. package/dist/components/ui/alert.d.ts +2 -2
  5. package/dist/components/ui/avatar.d.mts +1 -1
  6. package/dist/components/ui/avatar.d.ts +1 -1
  7. package/dist/components/ui/badge.d.mts +2 -2
  8. package/dist/components/ui/badge.d.ts +2 -2
  9. package/dist/components/ui/badge.js +54 -43
  10. package/dist/components/ui/badge.js.map +1 -1
  11. package/dist/components/ui/badge.mjs +55 -44
  12. package/dist/components/ui/badge.mjs.map +1 -1
  13. package/dist/components/ui/breadcrumb.js +15 -9
  14. package/dist/components/ui/breadcrumb.js.map +1 -1
  15. package/dist/components/ui/breadcrumb.mjs +15 -9
  16. package/dist/components/ui/breadcrumb.mjs.map +1 -1
  17. package/dist/components/ui/button.d.mts +2 -2
  18. package/dist/components/ui/button.d.ts +2 -2
  19. package/dist/components/ui/button.js +31 -20
  20. package/dist/components/ui/button.js.map +1 -1
  21. package/dist/components/ui/button.mjs +31 -20
  22. package/dist/components/ui/button.mjs.map +1 -1
  23. package/dist/components/ui/card.d.mts +2 -2
  24. package/dist/components/ui/card.d.ts +2 -2
  25. package/dist/components/ui/chart.d.mts +1 -1
  26. package/dist/components/ui/chart.d.ts +1 -1
  27. package/dist/components/ui/checkbox.d.mts +1 -1
  28. package/dist/components/ui/checkbox.d.ts +1 -1
  29. package/dist/components/ui/divider.d.mts +1 -1
  30. package/dist/components/ui/divider.d.ts +1 -1
  31. package/dist/components/ui/drawer.d.mts +2 -2
  32. package/dist/components/ui/drawer.d.ts +2 -2
  33. package/dist/components/ui/field.d.mts +1 -1
  34. package/dist/components/ui/field.d.ts +1 -1
  35. package/dist/components/ui/icon-button.d.mts +2 -2
  36. package/dist/components/ui/icon-button.d.ts +2 -2
  37. package/dist/components/ui/icon-button.js +24 -13
  38. package/dist/components/ui/icon-button.js.map +1 -1
  39. package/dist/components/ui/icon-button.mjs +24 -13
  40. package/dist/components/ui/icon-button.mjs.map +1 -1
  41. package/dist/components/ui/input.d.mts +2 -2
  42. package/dist/components/ui/input.d.ts +2 -2
  43. package/dist/components/ui/metric-card.d.mts +2 -2
  44. package/dist/components/ui/metric-card.d.ts +2 -2
  45. package/dist/components/ui/modal.d.mts +2 -2
  46. package/dist/components/ui/modal.d.ts +2 -2
  47. package/dist/components/ui/navigation-menu.js +25 -11
  48. package/dist/components/ui/navigation-menu.js.map +1 -1
  49. package/dist/components/ui/navigation-menu.mjs +25 -11
  50. package/dist/components/ui/navigation-menu.mjs.map +1 -1
  51. package/dist/components/ui/pagination.d.mts +1 -1
  52. package/dist/components/ui/pagination.d.ts +1 -1
  53. package/dist/components/ui/popover.d.mts +1 -1
  54. package/dist/components/ui/popover.d.ts +1 -1
  55. package/dist/components/ui/progress.d.mts +1 -1
  56. package/dist/components/ui/progress.d.ts +1 -1
  57. package/dist/components/ui/radio-group.d.mts +1 -1
  58. package/dist/components/ui/radio-group.d.ts +1 -1
  59. package/dist/components/ui/segmented.d.mts +4 -4
  60. package/dist/components/ui/segmented.d.ts +4 -4
  61. package/dist/components/ui/slider.d.mts +1 -1
  62. package/dist/components/ui/slider.d.ts +1 -1
  63. package/dist/components/ui/spinner.d.mts +1 -1
  64. package/dist/components/ui/spinner.d.ts +1 -1
  65. package/dist/components/ui/switch.d.mts +1 -1
  66. package/dist/components/ui/switch.d.ts +1 -1
  67. package/dist/components/ui/tabs.d.mts +1 -1
  68. package/dist/components/ui/tabs.d.ts +1 -1
  69. package/dist/components/ui/textarea.d.mts +1 -1
  70. package/dist/components/ui/textarea.d.ts +1 -1
  71. package/dist/components/ui/toast.d.mts +1 -1
  72. package/dist/components/ui/toast.d.ts +1 -1
  73. package/dist/components/ui/toggle-group.d.mts +2 -2
  74. package/dist/components/ui/toggle-group.d.ts +2 -2
  75. package/dist/components/ui/toggle.d.mts +2 -2
  76. package/dist/components/ui/toggle.d.ts +2 -2
  77. package/dist/components/ui/tooltip.d.mts +1 -1
  78. package/dist/components/ui/tooltip.d.ts +1 -1
  79. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/ui/icon-button.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport { Slot } from '@radix-ui/react-slot'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { cn } from '../../lib/utils'\nimport { useButtonGroup } from './button-group'\n\nimport { type ButtonColor } from './button'\n\n// Solid color maps (same as Button)\nconst solidColorMap = {\n default: 'bg-foreground text-background hover:bg-foreground/90 active:bg-foreground/80',\n primary: 'bg-primary text-primary-foreground hover:bg-primary-hover active:bg-primary-active',\n secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary-hover active:bg-secondary-active',\n destructive: 'bg-error text-error-foreground hover:bg-error-hover active:bg-error-active',\n} as const\n\nconst iconButtonVariants = cva(\n 'inline-flex items-center justify-center transition-all duration-micro focus-visible:focus-ring disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n variant: {\n solid: '',\n outline: 'border border-border-form bg-background text-foreground hover:bg-background-muted',\n ghost: 'text-foreground hover:bg-background-muted',\n subtle: 'text-text-muted hover:text-foreground',\n },\n size: {\n xs: 'h-7 w-7', // 28px - spacing.7\n sm: 'h-8 w-8', // 32px - spacing.8\n md: 'h-9 w-9', // 36px - spacing.9\n default: 'h-10 w-10', // 40px - spacing.10\n lg: 'h-12 w-12', // 48px - spacing.12\n },\n radius: {\n none: 'rounded-none', // 0px - primitive.borderRadius.none\n sm: 'rounded-sm', // 2px - primitive.borderRadius.sm\n base: 'rounded', // 4px - primitive.borderRadius.base\n default: 'rounded-md', // 6px - primitive.borderRadius.md (Figma button default)\n lg: 'rounded-lg', // 8px - primitive.borderRadius.lg\n xl: 'rounded-xl', // 12px - primitive.borderRadius.xl\n '2xl': 'rounded-2xl', // 16px - primitive.borderRadius.2xl\n '3xl': 'rounded-3xl', // 24px - primitive.borderRadius.3xl\n full: 'rounded-full', // 9999px - primitive.borderRadius.full\n },\n },\n defaultVariants: {\n variant: 'solid',\n size: 'default',\n radius: 'default',\n },\n }\n)\n\nexport interface IconButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof iconButtonVariants> {\n /** Solid variant color */\n color?: ButtonColor\n asChild?: boolean\n loading?: boolean\n pressEffect?: boolean\n}\n\nconst IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(\n ({ className, variant: variantProp, color: colorProp, size: sizeProp, radius: radiusProp, asChild = false, loading, pressEffect, children, disabled: disabledProp, ...props }, ref) => {\n const groupContext = useButtonGroup()\n\n // Priority: direct prop > ButtonGroup context > variant default\n const variant = variantProp ?? groupContext?.variant ?? 'solid'\n const color = colorProp ?? 'default'\n const size = sizeProp ?? groupContext?.size\n const radius = radiusProp ?? groupContext?.radius\n const disabled = disabledProp ?? groupContext?.disabled\n\n const Comp = asChild ? Slot : 'button'\n\n // Icon size for icon-only button (5-step scale)\n // XS: 14px, SM~MD: 16px, Default: 20px, LG: 24px\n const iconSize = {\n xs: 'icon-xs', // 14px\n sm: 'icon-sm', // 16px\n md: 'icon-sm', // 16px\n default: 'icon-md', // 20px\n lg: 'icon-lg', // 24px\n }[size || 'default']\n\n return (\n <Comp\n className={cn(iconButtonVariants({ variant, size, radius }), variant === 'solid' && solidColorMap[color], pressEffect !== false && 'active:scale-pressed', className)}\n ref={ref}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n {...props}\n >\n {loading ? (\n <svg\n className={cn(iconSize, 'animate-spin')}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <circle className=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" strokeWidth=\"4\" />\n <path className=\"opacity-75\" fill=\"currentColor\" d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\" />\n </svg>\n ) : (\n <span className={cn(iconSize, '[&>svg]:w-full [&>svg]:h-full')} aria-hidden=\"true\">\n {children}\n </span>\n )}\n </Comp>\n )\n }\n)\nIconButton.displayName = 'IconButton'\n\nexport { IconButton, iconButtonVariants }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiGU;AA/FV,YAAuB;AACvB,wBAAqB;AACrB,sCAAuC;AACvC,mBAAmB;AACnB,0BAA+B;AAK/B,MAAM,gBAAgB;AAAA,EACpB,SAAS;AAAA,EACT,SAAS;AAAA,EACT,WAAW;AAAA,EACX,aAAa;AACf;AAEA,MAAM,yBAAqB;AAAA,EACzB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,OAAO;AAAA,QACP,SAAS;AAAA,QACT,OAAO;AAAA,QACP,QAAQ;AAAA,MACV;AAAA,MACA,MAAM;AAAA,QACJ,IAAI;AAAA;AAAA,QACJ,IAAI;AAAA;AAAA,QACJ,IAAI;AAAA;AAAA,QACJ,SAAS;AAAA;AAAA,QACT,IAAI;AAAA;AAAA,MACN;AAAA,MACA,QAAQ;AAAA,QACN,MAAM;AAAA;AAAA,QACN,IAAI;AAAA;AAAA,QACJ,MAAM;AAAA;AAAA,QACN,SAAS;AAAA;AAAA,QACT,IAAI;AAAA;AAAA,QACJ,IAAI;AAAA;AAAA,QACJ,OAAO;AAAA;AAAA,QACP,OAAO;AAAA;AAAA,QACP,MAAM;AAAA;AAAA,MACR;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,MACN,QAAQ;AAAA,IACV;AAAA,EACF;AACF;AAYA,MAAM,aAAa,MAAM;AAAA,EACvB,CAAC,EAAE,WAAW,SAAS,aAAa,OAAO,WA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port * as React from 'react'\nimport { Slot } from '@radix-ui/react-slot'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { cn } from '../../lib/utils'\nimport { useButtonGroup } from './button-group'\n\nimport { type ButtonColor } from './button'\n\n// Solid color maps (same as Button)\nconst solidColorMap = {\n default: 'bg-foreground text-background hover:bg-foreground/90 active:bg-foreground/80',\n primary: 'bg-primary text-primary-foreground hover:bg-primary-hover active:bg-primary-active',\n secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary-hover active:bg-secondary-active',\n destructive: 'bg-error text-error-foreground hover:bg-error-hover active:bg-error-active',\n} as const\n\nconst iconButtonVariants = cva(\n 'inline-flex items-center justify-center transition-all duration-micro focus-visible:focus-ring disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n variant: {\n solid: '',\n outline: 'border border-border-form bg-background text-foreground hover:bg-background-muted',\n ghost: 'text-foreground hover:bg-background-muted',\n subtle: 'text-text-muted hover:text-foreground',\n },\n size: {\n xs: 'h-7 w-7', // 28px - spacing.7\n sm: 'h-8 w-8', // 32px - spacing.8\n md: 'h-9 w-9', // 36px - spacing.9\n default: 'h-10 w-10', // 40px - spacing.10\n lg: 'h-12 w-12', // 48px - spacing.12\n },\n radius: {\n none: 'rounded-none', // 0px - primitive.borderRadius.none\n sm: 'rounded-sm', // 2px - primitive.borderRadius.sm\n base: 'rounded', // 4px - primitive.borderRadius.base\n default: 'rounded-md', // 6px - primitive.borderRadius.md (Figma button default)\n lg: 'rounded-lg', // 8px - primitive.borderRadius.lg\n xl: 'rounded-xl', // 12px - primitive.borderRadius.xl\n '2xl': 'rounded-2xl', // 16px - primitive.borderRadius.2xl\n '3xl': 'rounded-3xl', // 24px - primitive.borderRadius.3xl\n full: 'rounded-full', // 9999px - primitive.borderRadius.full\n },\n },\n defaultVariants: {\n variant: 'solid',\n size: 'default',\n radius: 'default',\n },\n }\n)\n\nconst REACT_LAZY_TYPE = Symbol.for('react.lazy')\n\n// asChild: Slot merges props only into a single child element, so the icon\n// wrapper must go inside that child, not around it. Lazy children (from\n// Server Components) are resolved the same way Radix Slot does.\nfunction renderInsideChild(\n children: React.ReactNode,\n render: (content: React.ReactNode) => React.ReactNode\n): React.ReactNode {\n let child: unknown = children\n const resolve = (React as { use?: (usable: unknown) => unknown }).use\n if (\n typeof child === 'object' && child !== null &&\n (child as { $$typeof?: symbol }).$$typeof === REACT_LAZY_TYPE &&\n typeof resolve === 'function'\n ) {\n child = resolve((child as { _payload: unknown })._payload)\n }\n if (!React.isValidElement<{ children?: React.ReactNode }>(child)) return render(children)\n return React.cloneElement(child, undefined, render(child.props.children))\n}\n\nexport interface IconButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof iconButtonVariants> {\n /** Solid variant color */\n color?: ButtonColor\n asChild?: boolean\n loading?: boolean\n pressEffect?: boolean\n}\n\nconst IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(\n ({ className, variant: variantProp, color: colorProp, size: sizeProp, radius: radiusProp, asChild = false, loading, pressEffect, children, disabled: disabledProp, ...props }, ref) => {\n const groupContext = useButtonGroup()\n\n // Priority: direct prop > ButtonGroup context > variant default\n const variant = variantProp ?? groupContext?.variant ?? 'solid'\n const color = colorProp ?? 'default'\n const size = sizeProp ?? groupContext?.size\n const radius = radiusProp ?? groupContext?.radius\n const disabled = disabledProp ?? groupContext?.disabled\n\n const Comp = asChild ? Slot : 'button'\n\n // Icon size for icon-only button (5-step scale)\n // XS: 14px, SM~MD: 16px, Default: 20px, LG: 24px\n const iconSize = {\n xs: 'icon-xs', // 14px\n sm: 'icon-sm', // 16px\n md: 'icon-sm', // 16px\n default: 'icon-md', // 20px\n lg: 'icon-lg', // 24px\n }[size || 'default']\n\n const renderContent = (content: React.ReactNode) => loading ? (\n <svg\n className={cn(iconSize, 'animate-spin')}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <circle className=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" strokeWidth=\"4\" />\n <path className=\"opacity-75\" fill=\"currentColor\" d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\" />\n </svg>\n ) : (\n <span className={cn(iconSize, '[&>svg]:w-full [&>svg]:h-full')} aria-hidden=\"true\">\n {content}\n </span>\n )\n\n return (\n <Comp\n className={cn(iconButtonVariants({ variant, size, radius }), variant === 'solid' && solidColorMap[color], pressEffect !== false && 'active:scale-pressed', className)}\n ref={ref}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n {...props}\n >\n {asChild ? renderInsideChild(children, renderContent) : renderContent(children)}\n </Comp>\n )\n }\n)\nIconButton.displayName = 'IconButton'\n\nexport { IconButton, iconButtonVariants }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+GM;AA7GN,YAAuB;AACvB,wBAAqB;AACrB,sCAAuC;AACvC,mBAAmB;AACnB,0BAA+B;AAK/B,MAAM,gBAAgB;AAAA,EACpB,SAAS;AAAA,EACT,SAAS;AAAA,EACT,WAAW;AAAA,EACX,aAAa;AACf;AAEA,MAAM,yBAAqB;AAAA,EACzB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,OAAO;AAAA,QACP,SAAS;AAAA,QACT,OAAO;AAAA,QACP,QAAQ;AAAA,MACV;AAAA,MACA,MAAM;AAAA,QACJ,IAAI;AAAA;AAAA,QACJ,IAAI;AAAA;AAAA,QACJ,IAAI;AAAA;AAAA,QACJ,SAAS;AAAA;AAAA,QACT,IAAI;AAAA;AAAA,MACN;AAAA,MACA,QAAQ;AAAA,QACN,MAAM;AAAA;AAAA,QACN,IAAI;AAAA;AAAA,QACJ,MAAM;AAAA;AAAA,QACN,SAAS;AAAA;AAAA,QACT,IAAI;AAAA;AAAA,QACJ,IAAI;AAAA;AAAA,QACJ,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SAAQ;AAAA,QACR,eAAY;AAAA,QAEZ;AAAA,sDAAC,YAAO,WAAU,cAAa,IAAG,MAAK,IAAG,MAAK,GAAE,MAAK,QAAO,gBAAe,aAAY,KAAI;AAAA,UAC5F,4CAAC,UAAK,WAAU,cAAa,MAAK,gBAAe,GAAE,mHAAkH;AAAA;AAAA;AAAA,IACvK,IAEA,4CAAC,UAAK,eAAW,iBAAG,UAAU,+BAA+B,GAAG,eAAY,QACzE,mBACH;AAGF,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAW,iBAAG,mBAAmB,EAAE,SAAS,MAAM,OAAO,CAAC,GAAG,YAAY,WAAW,cAAc,KAAK,GAAG,gBAAgB,SAAS,wBAAwB,SAAS;AAAA,QACpK;AAAA,QACA,UAAU,YAAY;AAAA,QACtB,aAAW,WAAW;AAAA,QACrB,GAAG;AAAA,QAEH,oBAAU,kBAAkB,UAAU,aAAa,IAAI,cAAc,QAAQ;AAAA;AAAA,IAChF;AAAA,EAEJ;AACF;AACA,WAAW,cAAc;","names":[]}
@@ -61,6 +61,16 @@ const iconButtonVariants = cva(
61
61
  }
62
62
  }
63
63
  );
64
+ const REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
65
+ function renderInsideChild(children, render) {
66
+ let child = children;
67
+ const resolve = React.use;
68
+ if (typeof child === "object" && child !== null && child.$$typeof === REACT_LAZY_TYPE && typeof resolve === "function") {
69
+ child = resolve(child._payload);
70
+ }
71
+ if (!React.isValidElement(child)) return render(children);
72
+ return React.cloneElement(child, void 0, render(child.props.children));
73
+ }
64
74
  const IconButton = React.forwardRef(
65
75
  ({ className, variant: variantProp, color: colorProp, size: sizeProp, radius: radiusProp, asChild = false, loading, pressEffect, children, disabled: disabledProp, ...props }, ref) => {
66
76
  const groupContext = useButtonGroup();
@@ -82,6 +92,19 @@ const IconButton = React.forwardRef(
82
92
  lg: "icon-lg"
83
93
  // 24px
84
94
  }[size || "default"];
95
+ const renderContent = (content) => loading ? /* @__PURE__ */ jsxs(
96
+ "svg",
97
+ {
98
+ className: cn(iconSize, "animate-spin"),
99
+ fill: "none",
100
+ viewBox: "0 0 24 24",
101
+ "aria-hidden": "true",
102
+ children: [
103
+ /* @__PURE__ */ jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
104
+ /* @__PURE__ */ jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
105
+ ]
106
+ }
107
+ ) : /* @__PURE__ */ jsx("span", { className: cn(iconSize, "[&>svg]:w-full [&>svg]:h-full"), "aria-hidden": "true", children: content });
85
108
  return /* @__PURE__ */ jsx(
86
109
  Comp,
87
110
  {
@@ -90,19 +113,7 @@ const IconButton = React.forwardRef(
90
113
  disabled: disabled || loading,
91
114
  "aria-busy": loading || void 0,
92
115
  ...props,
93
- children: loading ? /* @__PURE__ */ jsxs(
94
- "svg",
95
- {
96
- className: cn(iconSize, "animate-spin"),
97
- fill: "none",
98
- viewBox: "0 0 24 24",
99
- "aria-hidden": "true",
100
- children: [
101
- /* @__PURE__ */ jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
102
- /* @__PURE__ */ jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
103
- ]
104
- }
105
- ) : /* @__PURE__ */ jsx("span", { className: cn(iconSize, "[&>svg]:w-full [&>svg]:h-full"), "aria-hidden": "true", children })
116
+ children: asChild ? renderInsideChild(children, renderContent) : renderContent(children)
106
117
  }
107
118
  );
108
119
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/ui/icon-button.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport { Slot } from '@radix-ui/react-slot'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { cn } from '../../lib/utils'\nimport { useButtonGroup } from './button-group'\n\nimport { type ButtonColor } from './button'\n\n// Solid color maps (same as Button)\nconst solidColorMap = {\n default: 'bg-foreground text-background hover:bg-foreground/90 active:bg-foreground/80',\n primary: 'bg-primary text-primary-foreground hover:bg-primary-hover active:bg-primary-active',\n secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary-hover active:bg-secondary-active',\n destructive: 'bg-error text-error-foreground hover:bg-error-hover active:bg-error-active',\n} as const\n\nconst iconButtonVariants = cva(\n 'inline-flex items-center justify-center transition-all duration-micro focus-visible:focus-ring disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n variant: {\n solid: '',\n outline: 'border border-border-form bg-background text-foreground hover:bg-background-muted',\n ghost: 'text-foreground hover:bg-background-muted',\n subtle: 'text-text-muted hover:text-foreground',\n },\n size: {\n xs: 'h-7 w-7', // 28px - spacing.7\n sm: 'h-8 w-8', // 32px - spacing.8\n md: 'h-9 w-9', // 36px - spacing.9\n default: 'h-10 w-10', // 40px - spacing.10\n lg: 'h-12 w-12', // 48px - spacing.12\n },\n radius: {\n none: 'rounded-none', // 0px - primitive.borderRadius.none\n sm: 'rounded-sm', // 2px - primitive.borderRadius.sm\n base: 'rounded', // 4px - primitive.borderRadius.base\n default: 'rounded-md', // 6px - primitive.borderRadius.md (Figma button default)\n lg: 'rounded-lg', // 8px - primitive.borderRadius.lg\n xl: 'rounded-xl', // 12px - primitive.borderRadius.xl\n '2xl': 'rounded-2xl', // 16px - primitive.borderRadius.2xl\n '3xl': 'rounded-3xl', // 24px - primitive.borderRadius.3xl\n full: 'rounded-full', // 9999px - primitive.borderRadius.full\n },\n },\n defaultVariants: {\n variant: 'solid',\n size: 'default',\n radius: 'default',\n },\n }\n)\n\nexport interface IconButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof iconButtonVariants> {\n /** Solid variant color */\n color?: ButtonColor\n asChild?: boolean\n loading?: boolean\n pressEffect?: boolean\n}\n\nconst IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(\n ({ className, variant: variantProp, color: colorProp, size: sizeProp, radius: radiusProp, asChild = false, loading, pressEffect, children, disabled: disabledProp, ...props }, ref) => {\n const groupContext = useButtonGroup()\n\n // Priority: direct prop > ButtonGroup context > variant default\n const variant = variantProp ?? groupContext?.variant ?? 'solid'\n const color = colorProp ?? 'default'\n const size = sizeProp ?? groupContext?.size\n const radius = radiusProp ?? groupContext?.radius\n const disabled = disabledProp ?? groupContext?.disabled\n\n const Comp = asChild ? Slot : 'button'\n\n // Icon size for icon-only button (5-step scale)\n // XS: 14px, SM~MD: 16px, Default: 20px, LG: 24px\n const iconSize = {\n xs: 'icon-xs', // 14px\n sm: 'icon-sm', // 16px\n md: 'icon-sm', // 16px\n default: 'icon-md', // 20px\n lg: 'icon-lg', // 24px\n }[size || 'default']\n\n return (\n <Comp\n className={cn(iconButtonVariants({ variant, size, radius }), variant === 'solid' && solidColorMap[color], pressEffect !== false && 'active:scale-pressed', className)}\n ref={ref}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n {...props}\n >\n {loading ? (\n <svg\n className={cn(iconSize, 'animate-spin')}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <circle className=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" strokeWidth=\"4\" />\n <path className=\"opacity-75\" fill=\"currentColor\" d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\" />\n </svg>\n ) : (\n <span className={cn(iconSize, '[&>svg]:w-full [&>svg]:h-full')} aria-hidden=\"true\">\n {children}\n </span>\n )}\n </Comp>\n )\n }\n)\nIconButton.displayName = 'IconButton'\n\nexport { IconButton, iconButtonVariants }\n"],"mappings":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AU,OAAO;AAI9B,UAAM,WAAW;AAAA,MACf,IAAI;AAAA;AAAA,MACJ,IAAI;AAAA;AAAA,MACJ,IAAI;AAAA;AAAA,MACJ,SAAS;AAAA;AAAA,MACT,IAAI;AAAA;AAAA,IACN,EAAE,QAAQ,SAAS;AAEnB,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAW,GAAG,mBAAmB,EAAE,SAAS,MAAM,OAAO,CAAC,GAAG,YAAY,WAAW,cAAc,KAAK,GAAG,gBAAgB,SAAS,wBAAwB,SAAS;AAAA,QACpK;AAAA,QACA,UAAU,YAAY;AAAA,QACtB,aAAW,WAAW;AAAA,QACrB,GAAG;AAAA,QAEH,oBACC;AAAA,UAAC;AAAA;AAAA,YACC,WAAW,GAAG,UAAU,cAAc;AAAA,YACtC,MAAK;AAAA,YACL,SAAQ;AAAA,YACR,eAAY;AAAA,YAEZ;AAAA,kCAAC,YAAO,WAAU,cAAa,IAAG,MAAK,IAAG,MAAK,GAAE,MAAK,QAAO,gBAAe,aAAY,KAAI;AAAA,cAC5F,oBAAC,UAAK,WAAU,cAAa,MAAK,gBAAe,GAAE,mHAAkH;AAAA;AAAA;AAAA,QACvK,IAEA,oBAAC,UAAK,WAAW,GAAG,UAAU,+BAA+B,GAAG,eAAY,QACzE,UACH;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;AACA,WAAW,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../../src/components/ui/icon-button.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport { Slot } from '@radix-ui/react-slot'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { cn } from '../../lib/utils'\nimport { useButtonGroup } from './button-group'\n\nimport { type ButtonColor } from './button'\n\n// Solid color maps (same as Button)\nconst solidColorMap = {\n default: 'bg-foreground text-background hover:bg-foreground/90 active:bg-foreground/80',\n primary: 'bg-primary text-primary-foreground hover:bg-primary-hover active:bg-primary-active',\n secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary-hover active:bg-secondary-active',\n destructive: 'bg-error text-error-foreground hover:bg-error-hover active:bg-error-active',\n} as const\n\nconst iconButtonVariants = cva(\n 'inline-flex items-center justify-center transition-all duration-micro focus-visible:focus-ring disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n variant: {\n solid: '',\n outline: 'border border-border-form bg-background text-foreground hover:bg-background-muted',\n ghost: 'text-foreground hover:bg-background-muted',\n subtle: 'text-text-muted hover:text-foreground',\n },\n size: {\n xs: 'h-7 w-7', // 28px - spacing.7\n sm: 'h-8 w-8', // 32px - spacing.8\n md: 'h-9 w-9', // 36px - spacing.9\n default: 'h-10 w-10', // 40px - spacing.10\n lg: 'h-12 w-12', // 48px - spacing.12\n },\n radius: {\n none: 'rounded-none', // 0px - primitive.borderRadius.none\n sm: 'rounded-sm', // 2px - primitive.borderRadius.sm\n base: 'rounded', // 4px - primitive.borderRadius.base\n default: 'rounded-md', // 6px - primitive.borderRadius.md (Figma button default)\n lg: 'rounded-lg', // 8px - primitive.borderRadius.lg\n xl: 'rounded-xl', // 12px - primitive.borderRadius.xl\n '2xl': 'rounded-2xl', // 16px - primitive.borderRadius.2xl\n '3xl': 'rounded-3xl', // 24px - primitive.borderRadius.3xl\n full: 'rounded-full', // 9999px - primitive.borderRadius.full\n },\n },\n defaultVariants: {\n variant: 'solid',\n size: 'default',\n radius: 'default',\n },\n }\n)\n\nconst REACT_LAZY_TYPE = Symbol.for('react.lazy')\n\n// asChild: Slot merges props only into a single child element, so the icon\n// wrapper must go inside that child, not around it. Lazy children (from\n// Server Components) are resolved the same way Radix Slot does.\nfunction renderInsideChild(\n children: React.ReactNode,\n render: (content: React.ReactNode) => React.ReactNode\n): React.ReactNode {\n let child: unknown = children\n const resolve = (React as { use?: (usable: unknown) => unknown }).use\n if (\n typeof child === 'object' && child !== null &&\n (child as { $$typeof?: symbol }).$$typeof === REACT_LAZY_TYPE &&\n typeof resolve === 'function'\n ) {\n child = resolve((child as { _payload: unknown })._payload)\n }\n if (!React.isValidElement<{ children?: React.ReactNode }>(child)) return render(children)\n return React.cloneElement(child, undefined, render(child.props.children))\n}\n\nexport interface IconButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof iconButtonVariants> {\n /** Solid variant color */\n color?: ButtonColor\n asChild?: boolean\n loading?: boolean\n pressEffect?: boolean\n}\n\nconst IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(\n ({ className, variant: variantProp, color: colorProp, size: sizeProp, radius: radiusProp, asChild = false, loading, pressEffect, children, disabled: disabledProp, ...props }, ref) => {\n const groupContext = useButtonGroup()\n\n // Priority: direct prop > ButtonGroup context > variant default\n const variant = variantProp ?? groupContext?.variant ?? 'solid'\n const color = colorProp ?? 'default'\n const size = sizeProp ?? groupContext?.size\n const radius = radiusProp ?? groupContext?.radius\n const disabled = disabledProp ?? groupContext?.disabled\n\n const Comp = asChild ? Slot : 'button'\n\n // Icon size for icon-only button (5-step scale)\n // XS: 14px, SM~MD: 16px, Default: 20px, LG: 24px\n const iconSize = {\n xs: 'icon-xs', // 14px\n sm: 'icon-sm', // 16px\n md: 'icon-sm', // 16px\n default: 'icon-md', // 20px\n lg: 'icon-lg', // 24px\n }[size || 'default']\n\n const renderContent = (content: React.ReactNode) => loading ? (\n <svg\n className={cn(iconSize, 'animate-spin')}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <circle className=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" strokeWidth=\"4\" />\n <path className=\"opacity-75\" fill=\"currentColor\" d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\" />\n </svg>\n ) : (\n <span className={cn(iconSize, '[&>svg]:w-full [&>svg]:h-full')} aria-hidden=\"true\">\n {content}\n </span>\n )\n\n return (\n <Comp\n className={cn(iconButtonVariants({ variant, size, radius }), variant === 'solid' && solidColorMap[color], pressEffect !== false && 'active:scale-pressed', className)}\n ref={ref}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n {...props}\n >\n {asChild ? renderInsideChild(children, renderContent) : renderContent(children)}\n </Comp>\n )\n }\n)\nIconButton.displayName = 'IconButton'\n\nexport { IconButton, iconButtonVariants }\n"],"mappings":";AA+GM,SAME,KANF;AA7GN,YAAY,WAAW;AACvB,SAAS,YAAY;AACrB,SAAS,WAA8B;AACvC,SAAS,UAAU;AACnB,SAAS,sBAAsB;AAK/B,MAAM,gBAAgB;AAAA,EACpB,SAAS;AAAA,EACT,SAAS;AAAA,EACT,WAAW;AAAA,EACX,aAAa;AACf;AAEA,MAAM,qBAAqB;AAAA,EACzB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,OAAO;AAAA,QACP,SAAS;AAAA,QACT,OAAO;AAAA,QACP,QAAQ;AAAA,MACV;AAAA,MACA,MAAM;AAAA,QACJ,IAAI;AAAA;AAAA,QACJ,IAAI;AAAA;AAAA,QACJ,IAAI;AAAA;AAAA,QACJ,SAAS;AAAA;AAAA,QACT,IAAI;AAAA;AAAA,MACN;AAAA,MACA,QAAQ;AAAA,QACN,MAAM;AAAA;AAAA,QACN,IAAI;AAAA;AAAA,QACJ,MAAM;AAAA;AAAA,QACN,SAAS;AAAA;AAAA,QACT,IAAI;AAAA;AAAA,QACJ,IAAI;AAAA;AAAA,QACJ,OAAO;AAAA;AAAA,QACP,OAAO;AAAA;AAAA,QACP,MAAM;AAAA;AAAA,MACR;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,MACN,QAAQ;AAAA,IACV;AAAA,EACF;AACF;AAEA,MAAM,kBAAkB,uBAAO,IAAI,YAAY;AAK/C,SAAS,kBACP,UACA,QACiB;AACjB,MAAI,QAAiB;AACrB,QAAM,UAAW,MAAiD;AAClE,MACE,OAAO,UAAU,YAAY,UAAU,QACtC,MAAgC,aAAa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,EAAE,SAAS,MAAM,OAAO,CAAC,GAAG,YAAY,WAAW,cAAc,KAAK,GAAG,gBAAgB,SAAS,wBAAwB,SAAS;AAAA,QACpK;AAAA,QACA,UAAU,YAAY;AAAA,QACtB,aAAW,WAAW;AAAA,QACrB,GAAG;AAAA,QAEH,oBAAU,kBAAkB,UAAU,aAAa,IAAI,cAAc,QAAQ;AAAA;AAAA,IAChF;AAAA,EAEJ;AACF;AACA,WAAW,cAAc;","names":[]}
@@ -5,8 +5,8 @@ import { VariantProps } from 'class-variance-authority';
5
5
  declare const inputVariants: (props?: ({
6
6
  variant?: "default" | "filled" | null | undefined;
7
7
  focusRing?: boolean | null | undefined;
8
- size?: "xs" | "sm" | "default" | "lg" | "xl" | null | undefined;
9
- radius?: "sm" | "default" | "lg" | "xl" | "2xl" | "base" | "none" | "3xl" | "full" | null | undefined;
8
+ size?: "default" | "sm" | "lg" | "xl" | "xs" | null | undefined;
9
+ radius?: "default" | "sm" | "lg" | "base" | "none" | "xl" | "2xl" | "3xl" | "full" | null | undefined;
10
10
  state?: "default" | "error" | null | undefined;
11
11
  } & class_variance_authority_types.ClassProp) | undefined) => string;
12
12
  interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'>, VariantProps<typeof inputVariants> {
@@ -5,8 +5,8 @@ import { VariantProps } from 'class-variance-authority';
5
5
  declare const inputVariants: (props?: ({
6
6
  variant?: "default" | "filled" | null | undefined;
7
7
  focusRing?: boolean | null | undefined;
8
- size?: "xs" | "sm" | "default" | "lg" | "xl" | null | undefined;
9
- radius?: "sm" | "default" | "lg" | "xl" | "2xl" | "base" | "none" | "3xl" | "full" | null | undefined;
8
+ size?: "default" | "sm" | "lg" | "xl" | "xs" | null | undefined;
9
+ radius?: "default" | "sm" | "lg" | "base" | "none" | "xl" | "2xl" | "3xl" | "full" | null | undefined;
10
10
  state?: "default" | "error" | null | undefined;
11
11
  } & class_variance_authority_types.ClassProp) | undefined) => string;
12
12
  interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'>, VariantProps<typeof inputVariants> {
@@ -4,8 +4,8 @@ import { VariantProps } from 'class-variance-authority';
4
4
 
5
5
  declare const metricCardVariants: (props?: ({
6
6
  variant?: "default" | "ghost" | "elevated" | null | undefined;
7
- size?: "sm" | "default" | "lg" | null | undefined;
8
- radius?: "sm" | "default" | "lg" | "xl" | "2xl" | "base" | "none" | "3xl" | "full" | null | undefined;
7
+ size?: "default" | "sm" | "lg" | null | undefined;
8
+ radius?: "default" | "sm" | "lg" | "base" | "none" | "xl" | "2xl" | "3xl" | "full" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  type MetricCardVariant = 'default' | 'elevated' | 'ghost';
11
11
  type MetricCardSize = 'sm' | 'default' | 'lg';
@@ -4,8 +4,8 @@ import { VariantProps } from 'class-variance-authority';
4
4
 
5
5
  declare const metricCardVariants: (props?: ({
6
6
  variant?: "default" | "ghost" | "elevated" | null | undefined;
7
- size?: "sm" | "default" | "lg" | null | undefined;
8
- radius?: "sm" | "default" | "lg" | "xl" | "2xl" | "base" | "none" | "3xl" | "full" | null | undefined;
7
+ size?: "default" | "sm" | "lg" | null | undefined;
8
+ radius?: "default" | "sm" | "lg" | "base" | "none" | "xl" | "2xl" | "3xl" | "full" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  type MetricCardVariant = 'default' | 'elevated' | 'ghost';
11
11
  type MetricCardSize = 'sm' | 'default' | 'lg';
@@ -10,7 +10,7 @@ declare const ModalPortal: React.FC<DialogPrimitive.DialogPortalProps>;
10
10
  declare const ModalClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
11
11
  declare const ModalOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
12
12
  declare const modalContentVariants: (props?: ({
13
- size?: "xs" | "sm" | "lg" | "xl" | "md" | "full" | null | undefined;
13
+ size?: "sm" | "lg" | "md" | "xl" | "full" | "xs" | null | undefined;
14
14
  } & class_variance_authority_types.ClassProp) | undefined) => string;
15
15
  interface ModalContentProps extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>, VariantProps<typeof modalContentVariants> {
16
16
  /** Scroll behavior when content overflows */
@@ -31,7 +31,7 @@ declare const AlertModalTrigger: React.ForwardRefExoticComponent<AlertDialogPrim
31
31
  declare const AlertModalPortal: React.FC<AlertDialogPrimitive.AlertDialogPortalProps>;
32
32
  declare const AlertModalOverlay: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
33
33
  declare const alertModalContentVariants: (props?: ({
34
- size?: "xs" | "sm" | null | undefined;
34
+ size?: "sm" | "xs" | null | undefined;
35
35
  } & class_variance_authority_types.ClassProp) | undefined) => string;
36
36
  interface AlertModalContentProps extends React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>, VariantProps<typeof alertModalContentVariants> {
37
37
  }
@@ -10,7 +10,7 @@ declare const ModalPortal: React.FC<DialogPrimitive.DialogPortalProps>;
10
10
  declare const ModalClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
11
11
  declare const ModalOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
12
12
  declare const modalContentVariants: (props?: ({
13
- size?: "xs" | "sm" | "lg" | "xl" | "md" | "full" | null | undefined;
13
+ size?: "sm" | "lg" | "md" | "xl" | "full" | "xs" | null | undefined;
14
14
  } & class_variance_authority_types.ClassProp) | undefined) => string;
15
15
  interface ModalContentProps extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>, VariantProps<typeof modalContentVariants> {
16
16
  /** Scroll behavior when content overflows */
@@ -31,7 +31,7 @@ declare const AlertModalTrigger: React.ForwardRefExoticComponent<AlertDialogPrim
31
31
  declare const AlertModalPortal: React.FC<AlertDialogPrimitive.AlertDialogPortalProps>;
32
32
  declare const AlertModalOverlay: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
33
33
  declare const alertModalContentVariants: (props?: ({
34
- size?: "xs" | "sm" | null | undefined;
34
+ size?: "sm" | "xs" | null | undefined;
35
35
  } & class_variance_authority_types.ClassProp) | undefined) => string;
36
36
  interface AlertModalContentProps extends React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>, VariantProps<typeof alertModalContentVariants> {
37
37
  }
@@ -53,6 +53,16 @@ function ChevronDownIcon({ className }) {
53
53
  function ChevronRightIcon({ className }) {
54
54
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { className, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) });
55
55
  }
56
+ const REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
57
+ function renderInsideChild(children, render) {
58
+ let child = children;
59
+ const resolve = React.use;
60
+ if (typeof child === "object" && child !== null && child.$$typeof === REACT_LAZY_TYPE && typeof resolve === "function") {
61
+ child = resolve(child._payload);
62
+ }
63
+ if (!React.isValidElement(child)) return render(children);
64
+ return React.cloneElement(child, void 0, render(child.props.children));
65
+ }
56
66
  const contentRadiusMap = {
57
67
  sm: "rounded",
58
68
  // 4px
@@ -416,8 +426,14 @@ const NavigationMenuLink = React.forwardRef(
416
426
  );
417
427
  }
418
428
  const Comp = asChild ? import_react_slot.Slot : "a";
429
+ const iconNode = icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: (0, import_utils.cn)("shrink-0", s.icon), children: icon });
430
+ const childText = asChild && React.isValidElement(children) ? children.props.children : children;
419
431
  if (inContent) {
420
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
432
+ const renderContent2 = (content) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
433
+ iconNode,
434
+ !collapsed && content
435
+ ] });
436
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
421
437
  Comp,
422
438
  {
423
439
  ref,
@@ -433,14 +449,15 @@ const NavigationMenuLink = React.forwardRef(
433
449
  ),
434
450
  ...active ? { "aria-current": "page" } : {},
435
451
  ...props,
436
- children: [
437
- icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: (0, import_utils.cn)("shrink-0", s.icon), children: icon }),
438
- !collapsed && children
439
- ]
452
+ children: asChild ? renderInsideChild(children, renderContent2) : renderContent2(children)
440
453
  }
441
454
  );
442
455
  }
443
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
456
+ const renderContent = (content) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
457
+ iconNode,
458
+ !collapsed && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "truncate", children: content })
459
+ ] });
460
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
444
461
  Comp,
445
462
  {
446
463
  ref,
@@ -455,12 +472,9 @@ const NavigationMenuLink = React.forwardRef(
455
472
  className
456
473
  ),
457
474
  ...active ? { "aria-current": "page" } : {},
458
- ...collapsed && typeof children === "string" ? { title: children } : {},
475
+ ...collapsed && typeof childText === "string" ? { title: childText } : {},
459
476
  ...props,
460
- children: [
461
- icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: (0, import_utils.cn)("shrink-0", s.icon), children: icon }),
462
- !collapsed && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "truncate", children })
463
- ]
477
+ children: asChild ? renderInsideChild(children, renderContent) : renderContent(children)
464
478
  }
465
479
  );
466
480
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/ui/navigation-menu.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu'\nimport * as CollapsiblePrimitive from '@radix-ui/react-collapsible'\nimport { Slot } from '@radix-ui/react-slot'\nimport { cn } from '../../lib/utils'\n\n// ─── Built-in Icons ───────────────────────────────────────\n\nfunction ChevronDownIcon({ className }: { className?: string }) {\n return (\n <svg className={className} fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2} aria-hidden=\"true\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M19 9l-7 7-7-7\" />\n </svg>\n )\n}\n\nfunction ChevronRightIcon({ className }: { className?: string }) {\n return (\n <svg className={className} fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2} aria-hidden=\"true\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M9 5l7 7-7 7\" />\n </svg>\n )\n}\n\n// ─── Radius Configuration ─────────────────────────────────\n\ntype NavigationMenuRadius = 'sm' | 'md' | 'lg' | 'xl'\n\nconst contentRadiusMap: Record<NavigationMenuRadius, string> = {\n sm: 'rounded', // 4px\n md: 'rounded-md', // 6px\n lg: 'rounded-lg', // 8px\n xl: 'rounded-xl', // 12px\n}\n\nconst itemRadiusMap: Record<NavigationMenuRadius, string> = {\n sm: 'rounded-sm', // 2px\n md: 'rounded', // 4px\n lg: 'rounded-md', // 6px\n xl: 'rounded-lg', // 8px\n}\n\n// ─── Contexts ─────────────────────────────────────────────\n\ntype NavigationMenuContextValue = {\n orientation: 'horizontal' | 'vertical'\n size: 'sm' | 'md' | 'default' | 'lg'\n collapsed: boolean\n radius: NavigationMenuRadius\n fontWeight: 'normal' | 'semibold'\n}\n\nconst NavigationMenuContext = React.createContext<NavigationMenuContextValue>({\n orientation: 'horizontal',\n size: 'default',\n collapsed: false,\n radius: 'lg',\n fontWeight: 'normal',\n})\nconst useNavigationMenuContext = () => React.useContext(NavigationMenuContext)\n\n// Whether we're inside NavigationMenuContent (affects link styling)\nconst ContentLevelContext = React.createContext(false)\n\n// ─── Size Configuration ───────────────────────────────────\n\nconst navigationMenuSizeMap = {\n sm: {\n trigger: 'h-8 text-sm px-3 gap-2',\n link: 'h-8 text-sm px-3 gap-2',\n icon: 'icon-xs',\n collapsedSquare: 'size-8', collapsedWidth: 56,\n dropdownLink: 'px-3 py-1.5 text-sm gap-2',\n subLink: 'h-8 text-sm pl-8 pr-3 gap-2',\n groupLabel: 'text-2xs px-3 mb-1', groupMargin: 'mt-4 first:mt-0',\n },\n md: {\n trigger: 'h-9 text-md px-3.5 gap-2',\n link: 'h-9 text-md px-3.5 gap-2',\n icon: 'icon-sm',\n collapsedSquare: 'size-9', collapsedWidth: 60,\n dropdownLink: 'px-3 py-1.5 text-md gap-2',\n subLink: 'h-9 text-md pl-9 pr-3.5 gap-2',\n groupLabel: 'text-xs px-3.5 mb-1', groupMargin: 'mt-4 first:mt-0',\n },\n default: {\n trigger: 'h-10 text-md px-4 gap-2',\n link: 'h-10 text-md px-4 gap-2',\n icon: 'icon-sm',\n collapsedSquare: 'size-10', collapsedWidth: 64,\n dropdownLink: 'px-3 py-2 text-md gap-2',\n subLink: 'h-10 text-md pl-10 pr-4 gap-2',\n groupLabel: 'text-xs px-4 mb-1.5', groupMargin: 'mt-5 first:mt-0',\n },\n lg: {\n trigger: 'h-12 text-base px-6 gap-2',\n link: 'h-12 text-base px-6 gap-2',\n icon: 'icon-sm',\n collapsedSquare: 'size-12', collapsedWidth: 72,\n dropdownLink: 'px-3 py-2.5 text-base gap-2',\n subLink: 'h-12 text-base pl-12 pr-6 gap-2',\n groupLabel: 'text-xs px-4 mb-2', groupMargin: 'mt-6 first:mt-0',\n },\n} as const\n\n// ─── NavigationMenu (Root) ────────────────────────────────\n\nexport interface NavigationMenuProps extends React.HTMLAttributes<HTMLElement> {\n /** Layout orientation */\n orientation?: 'horizontal' | 'vertical'\n /** Size of the menu items */\n size?: 'sm' | 'md' | 'default' | 'lg'\n /** Vertical only: show icons only (collapsed sidebar) */\n collapsed?: boolean\n /** Vertical only: sidebar width (default: 256px / 16rem) */\n width?: number | string\n /** Vertical only: collapsed sidebar width (default: 64px / 4rem) */\n collapsedWidth?: number | string\n /** Border radius for dropdown content and items */\n radius?: NavigationMenuRadius\n /** Font weight for menu items (default: normal, active items always use semibold) */\n fontWeight?: 'normal' | 'semibold'\n /** Horizontal only: delay before hover opens in ms */\n delayDuration?: number\n /** Horizontal only: skip delay when moving between triggers */\n skipDelayDuration?: number\n /** Controlled active menu item value */\n value?: string\n /** Default active menu item value (uncontrolled) */\n defaultValue?: string\n /** Callback when active item changes */\n onValueChange?: (value: string) => void\n}\n\nconst NavigationMenu = React.forwardRef<HTMLElement, NavigationMenuProps>(\n ({\n className,\n orientation = 'horizontal',\n size = 'default',\n collapsed = false,\n width,\n collapsedWidth,\n radius = 'lg',\n fontWeight = 'normal',\n delayDuration = 200,\n skipDelayDuration = 300,\n value,\n defaultValue,\n onValueChange,\n children,\n style,\n ...props\n }, ref) => {\n const contextValue = React.useMemo(\n () => ({ orientation, size, collapsed: orientation === 'vertical' ? collapsed : false, radius, fontWeight }),\n [orientation, size, collapsed, radius, fontWeight]\n )\n\n if (orientation === 'horizontal') {\n return (\n <NavigationMenuContext.Provider value={contextValue}>\n <NavigationMenuPrimitive.Root\n ref={ref as React.Ref<HTMLDivElement>}\n className={cn('relative', className)}\n delayDuration={delayDuration}\n skipDelayDuration={skipDelayDuration}\n value={value}\n defaultValue={defaultValue ?? ''}\n onValueChange={onValueChange}\n >\n {children}\n </NavigationMenuPrimitive.Root>\n </NavigationMenuContext.Provider>\n )\n }\n\n // Vertical mode\n const resolvedWidth = collapsed\n ? (collapsedWidth ?? navigationMenuSizeMap[size].collapsedWidth)\n : (width ?? 256)\n const widthValue = typeof resolvedWidth === 'number' ? `${resolvedWidth}px` : resolvedWidth\n\n return (\n <NavigationMenuContext.Provider value={contextValue}>\n <nav\n ref={ref}\n aria-label=\"navigation\"\n className={cn(\n 'flex flex-col',\n 'transition-[width] duration-normal ease-out',\n className\n )}\n style={{ width: widthValue, ...style }}\n {...props}\n >\n {children}\n </nav>\n </NavigationMenuContext.Provider>\n )\n }\n)\nNavigationMenu.displayName = 'NavigationMenu'\n\n// ─── NavigationMenuList ───────────────────────────────────\n\nexport interface NavigationMenuListProps extends React.HTMLAttributes<HTMLUListElement> {}\n\nconst NavigationMenuList = React.forwardRef<HTMLUListElement, NavigationMenuListProps>(\n ({ className, children, ...props }, ref) => {\n const { orientation } = useNavigationMenuContext()\n\n if (orientation === 'horizontal') {\n return (\n <NavigationMenuPrimitive.List\n ref={ref}\n className={cn('flex items-center gap-1', className)}\n {...props}\n >\n {children}\n </NavigationMenuPrimitive.List>\n )\n }\n\n return (\n <ul\n ref={ref}\n className={cn('flex flex-col gap-0.5', className)}\n {...props}\n >\n {children}\n </ul>\n )\n }\n)\nNavigationMenuList.displayName = 'NavigationMenuList'\n\n// ─── NavigationMenuItem ───────────────────────────────────\n\nexport interface NavigationMenuItemProps extends React.HTMLAttributes<HTMLLIElement> {\n /** Value identifier for Radix (horizontal mode) */\n value?: string\n /** Vertical only: default open state for sub-menu */\n defaultOpen?: boolean\n}\n\nconst NavigationMenuItem = React.forwardRef<HTMLLIElement, NavigationMenuItemProps>(\n ({ className, value, defaultOpen = false, children, ...props }, ref) => {\n const { orientation, collapsed } = useNavigationMenuContext()\n const [open, setOpen] = React.useState(defaultOpen)\n\n // Auto-close sub-menus when collapsed. Adjusted during render (React's pattern for\n // state that follows a prop) instead of in an effect, which re-rendered once more.\n const [prevCollapsed, setPrevCollapsed] = React.useState(collapsed)\n if (collapsed !== prevCollapsed) {\n setPrevCollapsed(collapsed)\n if (collapsed) setOpen(false)\n }\n\n if (orientation === 'horizontal') {\n return (\n <NavigationMenuPrimitive.Item\n ref={ref}\n className={cn('relative', className)}\n value={value}\n {...props}\n >\n {children}\n </NavigationMenuPrimitive.Item>\n )\n }\n\n // Vertical: wrap in Collapsible.Root for sub-menu support\n return (\n <CollapsiblePrimitive.Root\n open={collapsed ? false : open}\n onOpenChange={collapsed ? undefined : setOpen}\n asChild\n >\n <li ref={ref} className={cn('', className)} {...props}>\n {children}\n </li>\n </CollapsiblePrimitive.Root>\n )\n }\n)\nNavigationMenuItem.displayName = 'NavigationMenuItem'\n\n// ─── NavigationMenuTrigger ────────────────────────────────\n\nexport interface NavigationMenuTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /** Icon displayed before the label */\n icon?: React.ReactNode\n /** Custom chevron icon (default: built-in ChevronDown for horizontal, ChevronRight for vertical) */\n chevronIcon?: React.ReactNode\n}\n\nconst NavigationMenuTrigger = React.forwardRef<HTMLButtonElement, NavigationMenuTriggerProps>(\n ({ className, children, icon, chevronIcon, ...props }, ref) => {\n const { orientation, size, collapsed, radius, fontWeight: fw } = useNavigationMenuContext()\n const s = navigationMenuSizeMap[size]\n const fwClass = fw === 'semibold' ? 'font-semibold' : 'font-normal'\n\n if (orientation === 'horizontal') {\n return (\n <NavigationMenuPrimitive.Trigger\n ref={ref}\n className={cn(\n 'group inline-flex items-center justify-center',\n s.trigger,\n 'gap-0',\n fwClass, 'text-text-muted',\n 'transition-colors duration-fast',\n 'hover:text-foreground',\n 'data-[state=open]:text-foreground',\n 'focus-visible:focus-ring',\n 'disabled:pointer-events-none disabled:opacity-50',\n className\n )}\n {...props}\n >\n {icon && <span className={cn('shrink-0 mr-2', s.icon)}>{icon}</span>}\n {children}\n <span className={cn('shrink-0 ml-1 text-text-subtle transition-transform duration-fast group-data-[state=open]:rotate-180', s.icon)}>\n {chevronIcon ?? <ChevronDownIcon className=\"size-full\" />}\n </span>\n </NavigationMenuPrimitive.Trigger>\n )\n }\n\n // Vertical: Collapsible trigger\n return (\n <CollapsiblePrimitive.Trigger\n ref={ref}\n className={cn(\n 'group flex items-center cursor-pointer',\n contentRadiusMap[radius],\n collapsed\n ? [s.collapsedSquare, 'justify-center mx-auto']\n : ['w-full', s.trigger],\n fwClass, 'text-text-muted transition-colors duration-fast',\n 'hover:text-foreground hover:bg-background-muted',\n !collapsed && 'data-[state=open]:text-foreground',\n 'focus-visible:focus-ring',\n 'disabled:pointer-events-none disabled:opacity-50',\n className\n )}\n {...(collapsed && typeof children === 'string' ? { title: children } : {})}\n {...props}\n >\n {icon && <span className={cn('shrink-0', s.icon)}>{icon}</span>}\n {!collapsed && (\n <>\n <span className=\"flex-1 text-left truncate\">{children}</span>\n <span\n className={cn(\n 'shrink-0 text-text-subtle transition-transform duration-normal',\n s.icon,\n 'group-data-[state=open]:rotate-90'\n )}\n >\n {chevronIcon ?? <ChevronRightIcon className=\"size-full\" />}\n </span>\n </>\n )}\n </CollapsiblePrimitive.Trigger>\n )\n }\n)\nNavigationMenuTrigger.displayName = 'NavigationMenuTrigger'\n\n// ─── NavigationMenuContent ────────────────────────────────\n\nexport interface NavigationMenuContentProps extends React.HTMLAttributes<HTMLDivElement> {}\n\nconst NavigationMenuContent = React.forwardRef<HTMLDivElement, NavigationMenuContentProps>(\n ({ className, children, ...props }, ref) => {\n const { orientation, size, collapsed, radius } = useNavigationMenuContext()\n const s = navigationMenuSizeMap[size]\n\n if (orientation === 'horizontal') {\n return (\n <ContentLevelContext.Provider value={true}>\n <NavigationMenuPrimitive.Content\n ref={ref}\n className={cn(\n 'absolute left-0 top-full z-dropdown pt-1',\n 'data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out',\n className\n )}\n {...props}\n >\n <div className={cn('min-w-[180px] border border-border bg-background shadow-lg p-1.5 grid gap-0.5', contentRadiusMap[radius])}>\n {children}\n </div>\n </NavigationMenuPrimitive.Content>\n </ContentLevelContext.Provider>\n )\n }\n\n // Vertical: Collapsible content (hidden when collapsed)\n if (collapsed) return null\n\n return (\n <ContentLevelContext.Provider value={true}>\n <CollapsiblePrimitive.Content\n ref={ref}\n className={cn(\n 'overflow-hidden',\n 'data-[state=open]:animate-collapsible-down data-[state=closed]:animate-collapsible-up',\n )}\n {...props}\n >\n <div className={cn(\n 'flex flex-col gap-0.5 py-1',\n className\n )}>\n {children}\n </div>\n </CollapsiblePrimitive.Content>\n </ContentLevelContext.Provider>\n )\n }\n)\nNavigationMenuContent.displayName = 'NavigationMenuContent'\n\n// ─── NavigationMenuLink ───────────────────────────────────\n\nexport interface NavigationMenuLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {\n /** Whether the link represents the current page */\n active?: boolean\n /** Compose with custom link component (Radix Slot) */\n asChild?: boolean\n /** Icon displayed before the label */\n icon?: React.ReactNode\n}\n\nconst NavigationMenuLink = React.forwardRef<HTMLAnchorElement, NavigationMenuLinkProps>(\n ({ className, active, asChild, icon, children, ...props }, ref) => {\n const { orientation, size, collapsed, radius, fontWeight: fw } = useNavigationMenuContext()\n const s = navigationMenuSizeMap[size]\n const fwClass = fw === 'semibold' ? 'font-semibold' : 'font-normal'\n const inContent = React.useContext(ContentLevelContext)\n\n if (orientation === 'horizontal') {\n // Exclude onSelect to avoid React vs Radix type conflict\n const { onSelect, ...radixSafeProps } = props as any\n\n // Content-level links (inside dropdown): block style with hover bg\n if (inContent) {\n return (\n <NavigationMenuPrimitive.Link\n ref={ref}\n className={cn(\n 'flex items-center w-full',\n s.dropdownLink,\n itemRadiusMap[radius],\n 'text-text-muted transition-colors duration-fast',\n 'hover:text-foreground hover:bg-background-muted',\n active && 'text-foreground bg-background-muted font-semibold',\n 'focus-visible:focus-ring',\n className\n )}\n active={active}\n asChild={asChild}\n onSelect={onSelect}\n {...radixSafeProps}\n >\n {asChild ? children : (\n <>\n {icon && <span className={cn('shrink-0', s.icon)}>{icon}</span>}\n {children}\n </>\n )}\n </NavigationMenuPrimitive.Link>\n )\n }\n\n // Top-level horizontal links: text only, no hover bg\n return (\n <NavigationMenuPrimitive.Link\n ref={ref}\n className={cn(\n 'inline-flex items-center justify-center',\n s.link,\n fwClass, 'text-text-muted',\n 'transition-colors duration-fast',\n 'hover:text-foreground',\n active && 'text-foreground font-semibold',\n 'focus-visible:focus-ring',\n className\n )}\n active={active}\n asChild={asChild}\n onSelect={onSelect}\n {...radixSafeProps}\n >\n {asChild ? children : (\n <>\n {icon && <span className={cn('shrink-0', s.icon)}>{icon}</span>}\n {children}\n </>\n )}\n </NavigationMenuPrimitive.Link>\n )\n }\n\n // ── Vertical mode ──\n\n const Comp = asChild ? Slot : 'a'\n\n // Content-level links (sub-menu items): compact, indented\n if (inContent) {\n return (\n <Comp\n ref={ref}\n className={cn(\n 'flex items-center w-full cursor-pointer',\n contentRadiusMap[radius],\n s.subLink,\n 'text-text-muted transition-colors duration-fast',\n 'hover:text-foreground hover:bg-background-muted',\n active && 'text-foreground bg-background-muted font-semibold',\n 'focus-visible:focus-ring',\n className\n )}\n {...(active ? { 'aria-current': 'page' as const } : {})}\n {...props}\n >\n {icon && <span className={cn('shrink-0', s.icon)}>{icon}</span>}\n {!collapsed && children}\n </Comp>\n )\n }\n\n // Top-level vertical links\n return (\n <Comp\n ref={ref}\n className={cn(\n 'relative flex items-center cursor-pointer',\n contentRadiusMap[radius],\n collapsed\n ? [s.collapsedSquare, 'justify-center mx-auto']\n : ['w-full', s.link],\n 'text-text-muted transition-colors duration-fast',\n 'hover:text-foreground hover:bg-background-muted',\n active && 'text-foreground bg-background-muted font-semibold',\n 'focus-visible:focus-ring',\n className\n )}\n {...(active ? { 'aria-current': 'page' as const } : {})}\n {...(collapsed && typeof children === 'string' ? { title: children } : {})}\n {...props}\n >\n {icon && <span className={cn('shrink-0', s.icon)}>{icon}</span>}\n {!collapsed && <span className=\"truncate\">{children}</span>}\n </Comp>\n )\n }\n)\nNavigationMenuLink.displayName = 'NavigationMenuLink'\n\n// ─── NavigationMenuGroup (vertical only) ──────────────────\n\nexport interface NavigationMenuGroupProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Group header label */\n label?: string\n}\n\nconst NavigationMenuGroup = React.forwardRef<HTMLDivElement, NavigationMenuGroupProps>(\n ({ className, label, children, ...props }, ref) => {\n const { size, collapsed } = useNavigationMenuContext()\n const s = navigationMenuSizeMap[size]\n\n const labelId = React.useId()\n const showLabel = Boolean(label) && !collapsed\n\n // Groups sit inside NavigationMenuList's <ul>, so the group is wrapped in an <li> to\n // keep the list structure valid. The spacing class stays on that <li>: it relies on\n // :first-child among the list's children.\n return (\n <li className={cn(showLabel && s.groupMargin)}>\n <div\n ref={ref}\n role=\"group\"\n aria-labelledby={showLabel && !props['aria-label'] ? labelId : undefined}\n className={className}\n {...props}\n >\n {showLabel && (\n <div\n id={labelId}\n className={cn(\n 'font-semibold text-text-subtle uppercase tracking-wider select-none',\n s.groupLabel,\n )}\n >\n {label}\n </div>\n )}\n <ul className=\"flex flex-col gap-0.5\">\n {children}\n </ul>\n </div>\n </li>\n )\n }\n)\nNavigationMenuGroup.displayName = 'NavigationMenuGroup'\n\n// ─── NavigationMenuIndicator ──────────────────────────────\n\nexport interface NavigationMenuIndicatorProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Active indicator dot color (default: dark/foreground, primary: brand color) */\n color?: 'default' | 'primary'\n}\n\nconst NavigationMenuIndicator = React.forwardRef<HTMLDivElement, NavigationMenuIndicatorProps>(\n ({ className, color = 'default', ...props }, ref) => {\n const { orientation } = useNavigationMenuContext()\n\n // Vertical: active indicator is built into NavigationMenuLink styling\n if (orientation === 'vertical') return null\n\n return (\n <NavigationMenuPrimitive.Indicator\n ref={ref}\n className={cn(\n 'z-10 flex h-[3px] items-end justify-center overflow-hidden',\n 'transition-[width,transform] duration-normal ease-out',\n 'data-[state=visible]:animate-fade-in data-[state=hidden]:animate-fade-out',\n className\n )}\n {...props}\n >\n <div className={cn(\n 'relative h-full w-full rounded-full',\n color === 'default' ? 'bg-foreground' : 'bg-primary'\n )} />\n </NavigationMenuPrimitive.Indicator>\n )\n }\n)\nNavigationMenuIndicator.displayName = 'NavigationMenuIndicator'\n\n// ─── NavigationMenuViewport ───────────────────────────────\n\nexport interface NavigationMenuViewportProps extends React.HTMLAttributes<HTMLDivElement> {}\n\nconst NavigationMenuViewport = React.forwardRef<HTMLDivElement, NavigationMenuViewportProps>(\n ({ className, ...props }, ref) => {\n const { orientation } = useNavigationMenuContext()\n\n // Vertical mode does not use a viewport\n if (orientation === 'vertical') return null\n\n return (\n <div className=\"absolute left-0 top-full z-dropdown w-auto pt-1\">\n <NavigationMenuPrimitive.Viewport\n ref={ref}\n className={cn(\n 'relative overflow-hidden',\n 'border border-border bg-background rounded-xl shadow-lg',\n 'h-[var(--radix-navigation-menu-viewport-height)]',\n 'w-[var(--radix-navigation-menu-viewport-width)]',\n 'transition-[width,height] duration-fast ease-out',\n 'data-[state=open]:animate-nav-viewport-enter',\n 'data-[state=closed]:animate-nav-viewport-exit',\n className\n )}\n {...props}\n />\n </div>\n )\n }\n)\nNavigationMenuViewport.displayName = 'NavigationMenuViewport'\n\n// ─── Exports ──────────────────────────────────────────────\n\nexport {\n NavigationMenu,\n NavigationMenuList,\n NavigationMenuItem,\n NavigationMenuTrigger,\n NavigationMenuContent,\n NavigationMenuLink,\n NavigationMenuGroup,\n NavigationMenuIndicator,\n NavigationMenuViewport,\n navigationMenuSizeMap,\n type NavigationMenuRadius,\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaM;AAXN,YAAuB;AACvB,8BAAyC;AACzC,2BAAsC;AACtC,wBAAqB;AACrB,mBAAmB;AAInB,SAAS,gBAAgB,EAAE,UAAU,GAA2B;AAC9D,SACE,4CAAC,SAAI,WAAsB,MAAK,QAAO,SAAQ,aAAY,QAAO,gBAAe,aAAa,GAAG,eAAY,QAC3G,sDAAC,UAAK,eAAc,SAAQ,gBAAe,SAAQ,GAAE,kBAAiB,GACxE;AAEJ;AAEA,SAAS,iBAAiB,EAAE,UAAU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A,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,QACC,GAAG;AAAA;AAAA,IACN,GACF;AAAA,EAEJ;AACF;AACA,uBAAuB,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../../src/components/ui/navigation-menu.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu'\nimport * as CollapsiblePrimitive from '@radix-ui/react-collapsible'\nimport { Slot } from '@radix-ui/react-slot'\nimport { cn } from '../../lib/utils'\n\n// ─── Built-in Icons ───────────────────────────────────────\n\nfunction ChevronDownIcon({ className }: { className?: string }) {\n return (\n <svg className={className} fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2} aria-hidden=\"true\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M19 9l-7 7-7-7\" />\n </svg>\n )\n}\n\nfunction ChevronRightIcon({ className }: { className?: string }) {\n return (\n <svg className={className} fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2} aria-hidden=\"true\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M9 5l7 7-7 7\" />\n </svg>\n )\n}\n\n// ─── asChild Content ──────────────────────────────────────\n\nconst REACT_LAZY_TYPE = Symbol.for('react.lazy')\n\n// asChild: Slot merges props only into a single child element, so the icon and\n// text wrapper must go inside that child, not next to it. Lazy children (from\n// Server Components) are resolved the same way Radix Slot does.\nfunction renderInsideChild(\n children: React.ReactNode,\n render: (content: React.ReactNode) => React.ReactNode\n): React.ReactNode {\n let child: unknown = children\n const resolve = (React as { use?: (usable: unknown) => unknown }).use\n if (\n typeof child === 'object' && child !== null &&\n (child as { $$typeof?: symbol }).$$typeof === REACT_LAZY_TYPE &&\n typeof resolve === 'function'\n ) {\n child = resolve((child as { _payload: unknown })._payload)\n }\n if (!React.isValidElement<{ children?: React.ReactNode }>(child)) return render(children)\n return React.cloneElement(child, undefined, render(child.props.children))\n}\n\n// ─── Radius Configuration ─────────────────────────────────\n\ntype NavigationMenuRadius = 'sm' | 'md' | 'lg' | 'xl'\n\nconst contentRadiusMap: Record<NavigationMenuRadius, string> = {\n sm: 'rounded', // 4px\n md: 'rounded-md', // 6px\n lg: 'rounded-lg', // 8px\n xl: 'rounded-xl', // 12px\n}\n\nconst itemRadiusMap: Record<NavigationMenuRadius, string> = {\n sm: 'rounded-sm', // 2px\n md: 'rounded', // 4px\n lg: 'rounded-md', // 6px\n xl: 'rounded-lg', // 8px\n}\n\n// ─── Contexts ─────────────────────────────────────────────\n\ntype NavigationMenuContextValue = {\n orientation: 'horizontal' | 'vertical'\n size: 'sm' | 'md' | 'default' | 'lg'\n collapsed: boolean\n radius: NavigationMenuRadius\n fontWeight: 'normal' | 'semibold'\n}\n\nconst NavigationMenuContext = React.createContext<NavigationMenuContextValue>({\n orientation: 'horizontal',\n size: 'default',\n collapsed: false,\n radius: 'lg',\n fontWeight: 'normal',\n})\nconst useNavigationMenuContext = () => React.useContext(NavigationMenuContext)\n\n// Whether we're inside NavigationMenuContent (affects link styling)\nconst ContentLevelContext = React.createContext(false)\n\n// ─── Size Configuration ───────────────────────────────────\n\nconst navigationMenuSizeMap = {\n sm: {\n trigger: 'h-8 text-sm px-3 gap-2',\n link: 'h-8 text-sm px-3 gap-2',\n icon: 'icon-xs',\n collapsedSquare: 'size-8', collapsedWidth: 56,\n dropdownLink: 'px-3 py-1.5 text-sm gap-2',\n subLink: 'h-8 text-sm pl-8 pr-3 gap-2',\n groupLabel: 'text-2xs px-3 mb-1', groupMargin: 'mt-4 first:mt-0',\n },\n md: {\n trigger: 'h-9 text-md px-3.5 gap-2',\n link: 'h-9 text-md px-3.5 gap-2',\n icon: 'icon-sm',\n collapsedSquare: 'size-9', collapsedWidth: 60,\n dropdownLink: 'px-3 py-1.5 text-md gap-2',\n subLink: 'h-9 text-md pl-9 pr-3.5 gap-2',\n groupLabel: 'text-xs px-3.5 mb-1', groupMargin: 'mt-4 first:mt-0',\n },\n default: {\n trigger: 'h-10 text-md px-4 gap-2',\n link: 'h-10 text-md px-4 gap-2',\n icon: 'icon-sm',\n collapsedSquare: 'size-10', collapsedWidth: 64,\n dropdownLink: 'px-3 py-2 text-md gap-2',\n subLink: 'h-10 text-md pl-10 pr-4 gap-2',\n groupLabel: 'text-xs px-4 mb-1.5', groupMargin: 'mt-5 first:mt-0',\n },\n lg: {\n trigger: 'h-12 text-base px-6 gap-2',\n link: 'h-12 text-base px-6 gap-2',\n icon: 'icon-sm',\n collapsedSquare: 'size-12', collapsedWidth: 72,\n dropdownLink: 'px-3 py-2.5 text-base gap-2',\n subLink: 'h-12 text-base pl-12 pr-6 gap-2',\n groupLabel: 'text-xs px-4 mb-2', groupMargin: 'mt-6 first:mt-0',\n },\n} as const\n\n// ─── NavigationMenu (Root) ────────────────────────────────\n\nexport interface NavigationMenuProps extends React.HTMLAttributes<HTMLElement> {\n /** Layout orientation */\n orientation?: 'horizontal' | 'vertical'\n /** Size of the menu items */\n size?: 'sm' | 'md' | 'default' | 'lg'\n /** Vertical only: show icons only (collapsed sidebar) */\n collapsed?: boolean\n /** Vertical only: sidebar width (default: 256px / 16rem) */\n width?: number | string\n /** Vertical only: collapsed sidebar width (default: 64px / 4rem) */\n collapsedWidth?: number | string\n /** Border radius for dropdown content and items */\n radius?: NavigationMenuRadius\n /** Font weight for menu items (default: normal, active items always use semibold) */\n fontWeight?: 'normal' | 'semibold'\n /** Horizontal only: delay before hover opens in ms */\n delayDuration?: number\n /** Horizontal only: skip delay when moving between triggers */\n skipDelayDuration?: number\n /** Controlled active menu item value */\n value?: string\n /** Default active menu item value (uncontrolled) */\n defaultValue?: string\n /** Callback when active item changes */\n onValueChange?: (value: string) => void\n}\n\nconst NavigationMenu = React.forwardRef<HTMLElement, NavigationMenuProps>(\n ({\n className,\n orientation = 'horizontal',\n size = 'default',\n collapsed = false,\n width,\n collapsedWidth,\n radius = 'lg',\n fontWeight = 'normal',\n delayDuration = 200,\n skipDelayDuration = 300,\n value,\n defaultValue,\n onValueChange,\n children,\n style,\n ...props\n }, ref) => {\n const contextValue = React.useMemo(\n () => ({ orientation, size, collapsed: orientation === 'vertical' ? collapsed : false, radius, fontWeight }),\n [orientation, size, collapsed, radius, fontWeight]\n )\n\n if (orientation === 'horizontal') {\n return (\n <NavigationMenuContext.Provider value={contextValue}>\n <NavigationMenuPrimitive.Root\n ref={ref as React.Ref<HTMLDivElement>}\n className={cn('relative', className)}\n delayDuration={delayDuration}\n skipDelayDuration={skipDelayDuration}\n value={value}\n defaultValue={defaultValue ?? ''}\n onValueChange={onValueChange}\n >\n {children}\n </NavigationMenuPrimitive.Root>\n </NavigationMenuContext.Provider>\n )\n }\n\n // Vertical mode\n const resolvedWidth = collapsed\n ? (collapsedWidth ?? navigationMenuSizeMap[size].collapsedWidth)\n : (width ?? 256)\n const widthValue = typeof resolvedWidth === 'number' ? `${resolvedWidth}px` : resolvedWidth\n\n return (\n <NavigationMenuContext.Provider value={contextValue}>\n <nav\n ref={ref}\n aria-label=\"navigation\"\n className={cn(\n 'flex flex-col',\n 'transition-[width] duration-normal ease-out',\n className\n )}\n style={{ width: widthValue, ...style }}\n {...props}\n >\n {children}\n </nav>\n </NavigationMenuContext.Provider>\n )\n }\n)\nNavigationMenu.displayName = 'NavigationMenu'\n\n// ─── NavigationMenuList ───────────────────────────────────\n\nexport interface NavigationMenuListProps extends React.HTMLAttributes<HTMLUListElement> {}\n\nconst NavigationMenuList = React.forwardRef<HTMLUListElement, NavigationMenuListProps>(\n ({ className, children, ...props }, ref) => {\n const { orientation } = useNavigationMenuContext()\n\n if (orientation === 'horizontal') {\n return (\n <NavigationMenuPrimitive.List\n ref={ref}\n className={cn('flex items-center gap-1', className)}\n {...props}\n >\n {children}\n </NavigationMenuPrimitive.List>\n )\n }\n\n return (\n <ul\n ref={ref}\n className={cn('flex flex-col gap-0.5', className)}\n {...props}\n >\n {children}\n </ul>\n )\n }\n)\nNavigationMenuList.displayName = 'NavigationMenuList'\n\n// ─── NavigationMenuItem ───────────────────────────────────\n\nexport interface NavigationMenuItemProps extends React.HTMLAttributes<HTMLLIElement> {\n /** Value identifier for Radix (horizontal mode) */\n value?: string\n /** Vertical only: default open state for sub-menu */\n defaultOpen?: boolean\n}\n\nconst NavigationMenuItem = React.forwardRef<HTMLLIElement, NavigationMenuItemProps>(\n ({ className, value, defaultOpen = false, children, ...props }, ref) => {\n const { orientation, collapsed } = useNavigationMenuContext()\n const [open, setOpen] = React.useState(defaultOpen)\n\n // Auto-close sub-menus when collapsed. Adjusted during render (React's pattern for\n // state that follows a prop) instead of in an effect, which re-rendered once more.\n const [prevCollapsed, setPrevCollapsed] = React.useState(collapsed)\n if (collapsed !== prevCollapsed) {\n setPrevCollapsed(collapsed)\n if (collapsed) setOpen(false)\n }\n\n if (orientation === 'horizontal') {\n return (\n <NavigationMenuPrimitive.Item\n ref={ref}\n className={cn('relative', className)}\n value={value}\n {...props}\n >\n {children}\n </NavigationMenuPrimitive.Item>\n )\n }\n\n // Vertical: wrap in Collapsible.Root for sub-menu support\n return (\n <CollapsiblePrimitive.Root\n open={collapsed ? false : open}\n onOpenChange={collapsed ? undefined : setOpen}\n asChild\n >\n <li ref={ref} className={cn('', className)} {...props}>\n {children}\n </li>\n </CollapsiblePrimitive.Root>\n )\n }\n)\nNavigationMenuItem.displayName = 'NavigationMenuItem'\n\n// ─── NavigationMenuTrigger ────────────────────────────────\n\nexport interface NavigationMenuTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /** Icon displayed before the label */\n icon?: React.ReactNode\n /** Custom chevron icon (default: built-in ChevronDown for horizontal, ChevronRight for vertical) */\n chevronIcon?: React.ReactNode\n}\n\nconst NavigationMenuTrigger = React.forwardRef<HTMLButtonElement, NavigationMenuTriggerProps>(\n ({ className, children, icon, chevronIcon, ...props }, ref) => {\n const { orientation, size, collapsed, radius, fontWeight: fw } = useNavigationMenuContext()\n const s = navigationMenuSizeMap[size]\n const fwClass = fw === 'semibold' ? 'font-semibold' : 'font-normal'\n\n if (orientation === 'horizontal') {\n return (\n <NavigationMenuPrimitive.Trigger\n ref={ref}\n className={cn(\n 'group inline-flex items-center justify-center',\n s.trigger,\n 'gap-0',\n fwClass, 'text-text-muted',\n 'transition-colors duration-fast',\n 'hover:text-foreground',\n 'data-[state=open]:text-foreground',\n 'focus-visible:focus-ring',\n 'disabled:pointer-events-none disabled:opacity-50',\n className\n )}\n {...props}\n >\n {icon && <span className={cn('shrink-0 mr-2', s.icon)}>{icon}</span>}\n {children}\n <span className={cn('shrink-0 ml-1 text-text-subtle transition-transform duration-fast group-data-[state=open]:rotate-180', s.icon)}>\n {chevronIcon ?? <ChevronDownIcon className=\"size-full\" />}\n </span>\n </NavigationMenuPrimitive.Trigger>\n )\n }\n\n // Vertical: Collapsible trigger\n return (\n <CollapsiblePrimitive.Trigger\n ref={ref}\n className={cn(\n 'group flex items-center cursor-pointer',\n contentRadiusMap[radius],\n collapsed\n ? [s.collapsedSquare, 'justify-center mx-auto']\n : ['w-full', s.trigger],\n fwClass, 'text-text-muted transition-colors duration-fast',\n 'hover:text-foreground hover:bg-background-muted',\n !collapsed && 'data-[state=open]:text-foreground',\n 'focus-visible:focus-ring',\n 'disabled:pointer-events-none disabled:opacity-50',\n className\n )}\n {...(collapsed && typeof children === 'string' ? { title: children } : {})}\n {...props}\n >\n {icon && <span className={cn('shrink-0', s.icon)}>{icon}</span>}\n {!collapsed && (\n <>\n <span className=\"flex-1 text-left truncate\">{children}</span>\n <span\n className={cn(\n 'shrink-0 text-text-subtle transition-transform duration-normal',\n s.icon,\n 'group-data-[state=open]:rotate-90'\n )}\n >\n {chevronIcon ?? <ChevronRightIcon className=\"size-full\" />}\n </span>\n </>\n )}\n </CollapsiblePrimitive.Trigger>\n )\n }\n)\nNavigationMenuTrigger.displayName = 'NavigationMenuTrigger'\n\n// ─── NavigationMenuContent ────────────────────────────────\n\nexport interface NavigationMenuContentProps extends React.HTMLAttributes<HTMLDivElement> {}\n\nconst NavigationMenuContent = React.forwardRef<HTMLDivElement, NavigationMenuContentProps>(\n ({ className, children, ...props }, ref) => {\n const { orientation, size, collapsed, radius } = useNavigationMenuContext()\n const s = navigationMenuSizeMap[size]\n\n if (orientation === 'horizontal') {\n return (\n <ContentLevelContext.Provider value={true}>\n <NavigationMenuPrimitive.Content\n ref={ref}\n className={cn(\n 'absolute left-0 top-full z-dropdown pt-1',\n 'data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out',\n className\n )}\n {...props}\n >\n <div className={cn('min-w-[180px] border border-border bg-background shadow-lg p-1.5 grid gap-0.5', contentRadiusMap[radius])}>\n {children}\n </div>\n </NavigationMenuPrimitive.Content>\n </ContentLevelContext.Provider>\n )\n }\n\n // Vertical: Collapsible content (hidden when collapsed)\n if (collapsed) return null\n\n return (\n <ContentLevelContext.Provider value={true}>\n <CollapsiblePrimitive.Content\n ref={ref}\n className={cn(\n 'overflow-hidden',\n 'data-[state=open]:animate-collapsible-down data-[state=closed]:animate-collapsible-up',\n )}\n {...props}\n >\n <div className={cn(\n 'flex flex-col gap-0.5 py-1',\n className\n )}>\n {children}\n </div>\n </CollapsiblePrimitive.Content>\n </ContentLevelContext.Provider>\n )\n }\n)\nNavigationMenuContent.displayName = 'NavigationMenuContent'\n\n// ─── NavigationMenuLink ───────────────────────────────────\n\nexport interface NavigationMenuLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {\n /** Whether the link represents the current page */\n active?: boolean\n /** Compose with custom link component (Radix Slot) */\n asChild?: boolean\n /** Icon displayed before the label */\n icon?: React.ReactNode\n}\n\nconst NavigationMenuLink = React.forwardRef<HTMLAnchorElement, NavigationMenuLinkProps>(\n ({ className, active, asChild, icon, children, ...props }, ref) => {\n const { orientation, size, collapsed, radius, fontWeight: fw } = useNavigationMenuContext()\n const s = navigationMenuSizeMap[size]\n const fwClass = fw === 'semibold' ? 'font-semibold' : 'font-normal'\n const inContent = React.useContext(ContentLevelContext)\n\n if (orientation === 'horizontal') {\n // Exclude onSelect to avoid React vs Radix type conflict\n const { onSelect, ...radixSafeProps } = props as any\n\n // Content-level links (inside dropdown): block style with hover bg\n if (inContent) {\n return (\n <NavigationMenuPrimitive.Link\n ref={ref}\n className={cn(\n 'flex items-center w-full',\n s.dropdownLink,\n itemRadiusMap[radius],\n 'text-text-muted transition-colors duration-fast',\n 'hover:text-foreground hover:bg-background-muted',\n active && 'text-foreground bg-background-muted font-semibold',\n 'focus-visible:focus-ring',\n className\n )}\n active={active}\n asChild={asChild}\n onSelect={onSelect}\n {...radixSafeProps}\n >\n {asChild ? children : (\n <>\n {icon && <span className={cn('shrink-0', s.icon)}>{icon}</span>}\n {children}\n </>\n )}\n </NavigationMenuPrimitive.Link>\n )\n }\n\n // Top-level horizontal links: text only, no hover bg\n return (\n <NavigationMenuPrimitive.Link\n ref={ref}\n className={cn(\n 'inline-flex items-center justify-center',\n s.link,\n fwClass, 'text-text-muted',\n 'transition-colors duration-fast',\n 'hover:text-foreground',\n active && 'text-foreground font-semibold',\n 'focus-visible:focus-ring',\n className\n )}\n active={active}\n asChild={asChild}\n onSelect={onSelect}\n {...radixSafeProps}\n >\n {asChild ? children : (\n <>\n {icon && <span className={cn('shrink-0', s.icon)}>{icon}</span>}\n {children}\n </>\n )}\n </NavigationMenuPrimitive.Link>\n )\n }\n\n // ── Vertical mode ──\n\n const Comp = asChild ? Slot : 'a'\n const iconNode = icon && <span className={cn('shrink-0', s.icon)}>{icon}</span>\n // With asChild the text lives inside the child element; use it for the collapsed tooltip too\n const childText = asChild && React.isValidElement<{ children?: React.ReactNode }>(children)\n ? children.props.children\n : children\n\n // Content-level links (sub-menu items): compact, indented\n if (inContent) {\n const renderContent = (content: React.ReactNode) => (\n <>\n {iconNode}\n {!collapsed && content}\n </>\n )\n\n return (\n <Comp\n ref={ref}\n className={cn(\n 'flex items-center w-full cursor-pointer',\n contentRadiusMap[radius],\n s.subLink,\n 'text-text-muted transition-colors duration-fast',\n 'hover:text-foreground hover:bg-background-muted',\n active && 'text-foreground bg-background-muted font-semibold',\n 'focus-visible:focus-ring',\n className\n )}\n {...(active ? { 'aria-current': 'page' as const } : {})}\n {...props}\n >\n {asChild ? renderInsideChild(children, renderContent) : renderContent(children)}\n </Comp>\n )\n }\n\n // Top-level vertical links\n const renderContent = (content: React.ReactNode) => (\n <>\n {iconNode}\n {!collapsed && <span className=\"truncate\">{content}</span>}\n </>\n )\n\n return (\n <Comp\n ref={ref}\n className={cn(\n 'relative flex items-center cursor-pointer',\n contentRadiusMap[radius],\n collapsed\n ? [s.collapsedSquare, 'justify-center mx-auto']\n : ['w-full', s.link],\n 'text-text-muted transition-colors duration-fast',\n 'hover:text-foreground hover:bg-background-muted',\n active && 'text-foreground bg-background-muted font-semibold',\n 'focus-visible:focus-ring',\n className\n )}\n {...(active ? { 'aria-current': 'page' as const } : {})}\n {...(collapsed && typeof childText === 'string' ? { title: childText } : {})}\n {...props}\n >\n {asChild ? renderInsideChild(children, renderContent) : renderContent(children)}\n </Comp>\n )\n }\n)\nNavigationMenuLink.displayName = 'NavigationMenuLink'\n\n// ─── NavigationMenuGroup (vertical only) ──────────────────\n\nexport interface NavigationMenuGroupProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Group header label */\n label?: string\n}\n\nconst NavigationMenuGroup = React.forwardRef<HTMLDivElement, NavigationMenuGroupProps>(\n ({ className, label, children, ...props }, ref) => {\n const { size, collapsed } = useNavigationMenuContext()\n const s = navigationMenuSizeMap[size]\n\n const labelId = React.useId()\n const showLabel = Boolean(label) && !collapsed\n\n // Groups sit inside NavigationMenuList's <ul>, so the group is wrapped in an <li> to\n // keep the list structure valid. The spacing class stays on that <li>: it relies on\n // :first-child among the list's children.\n return (\n <li className={cn(showLabel && s.groupMargin)}>\n <div\n ref={ref}\n role=\"group\"\n aria-labelledby={showLabel && !props['aria-label'] ? labelId : undefined}\n className={className}\n {...props}\n >\n {showLabel && (\n <div\n id={labelId}\n className={cn(\n 'font-semibold text-text-subtle uppercase tracking-wider select-none',\n s.groupLabel,\n )}\n >\n {label}\n </div>\n )}\n <ul className=\"flex flex-col gap-0.5\">\n {children}\n </ul>\n </div>\n </li>\n )\n }\n)\nNavigationMenuGroup.displayName = 'NavigationMenuGroup'\n\n// ─── NavigationMenuIndicator ──────────────────────────────\n\nexport interface NavigationMenuIndicatorProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Active indicator dot color (default: dark/foreground, primary: brand color) */\n color?: 'default' | 'primary'\n}\n\nconst NavigationMenuIndicator = React.forwardRef<HTMLDivElement, NavigationMenuIndicatorProps>(\n ({ className, color = 'default', ...props }, ref) => {\n const { orientation } = useNavigationMenuContext()\n\n // Vertical: active indicator is built into NavigationMenuLink styling\n if (orientation === 'vertical') return null\n\n return (\n <NavigationMenuPrimitive.Indicator\n ref={ref}\n className={cn(\n 'z-10 flex h-[3px] items-end justify-center overflow-hidden',\n 'transition-[width,transform] duration-normal ease-out',\n 'data-[state=visible]:animate-fade-in data-[state=hidden]:animate-fade-out',\n className\n )}\n {...props}\n >\n <div className={cn(\n 'relative h-full w-full rounded-full',\n color === 'default' ? 'bg-foreground' : 'bg-primary'\n )} />\n </NavigationMenuPrimitive.Indicator>\n )\n }\n)\nNavigationMenuIndicator.displayName = 'NavigationMenuIndicator'\n\n// ─── NavigationMenuViewport ───────────────────────────────\n\nexport interface NavigationMenuViewportProps extends React.HTMLAttributes<HTMLDivElement> {}\n\nconst NavigationMenuViewport = React.forwardRef<HTMLDivElement, NavigationMenuViewportProps>(\n ({ className, ...props }, ref) => {\n const { orientation } = useNavigationMenuContext()\n\n // Vertical mode does not use a viewport\n if (orientation === 'vertical') return null\n\n return (\n <div className=\"absolute left-0 top-full z-dropdown w-auto pt-1\">\n <NavigationMenuPrimitive.Viewport\n ref={ref}\n className={cn(\n 'relative overflow-hidden',\n 'border border-border bg-background rounded-xl shadow-lg',\n 'h-[var(--radix-navigation-menu-viewport-height)]',\n 'w-[var(--radix-navigation-menu-viewport-width)]',\n 'transition-[width,height] duration-fast ease-out',\n 'data-[state=open]:animate-nav-viewport-enter',\n 'data-[state=closed]:animate-nav-viewport-exit',\n className\n )}\n {...props}\n />\n </div>\n )\n }\n)\nNavigationMenuViewport.displayName = 'NavigationMenuViewport'\n\n// ─── Exports ──────────────────────────────────────────────\n\nexport {\n NavigationMenu,\n NavigationMenuList,\n NavigationMenuItem,\n NavigationMenuTrigger,\n NavigationMenuContent,\n NavigationMenuLink,\n NavigationMenuGroup,\n NavigationMenuIndicator,\n NavigationMenuViewport,\n navigationMenuSizeMap,\n type NavigationMenuRadius,\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaM;AAXN,YAAuB;AACvB,8BAAyC;AACzC,2BAAsC;AACtC,wBAAqB;AACrB,mBAAmB;AAInB,SAAS,gBAAgB,EAAE,UAAU,GAA2B;AAC9D,SACE,4CAAC,SAAI,WAAsB,MAAK,QAAO,SAAQ,aAAY,QAAO,gBAAe,aAAa,GAAG,eAAY,QAC3G,sDAAC,UAAK,eAAc,SAAQ,gBAAe,SAAQ,GAAE,kBAAiB,GACxE;AAEJ;AAEA,SAAS,iBAAiB,EAAE,UAAU,GAA2B;AAC/D,SACE,4CAAC,SAAI,WAAsB,MAAK,QAAO,SAAQ,aAAY,QAAO,gBAAe,aAAa,GAAG,eAAY,QAC3G,sDAAC,UAAK,eAAc,SAAQ,gBAAe,SAAQ,GAAE,gBAAe,GACtE;AAEJ;AAIA,MAAM,kBAAkB,uBAAO,IAAI,YAAY;AAK/C,SAAS,kBACP,UACA,QACiB;AACjB,MAAI,QAAiB;AACrB,QAAM,UAAW,MAAiD;AAClE,MACE,OAAO,UAAU,YAAY,UAAU,QACtC,MAAgC,aAAa,mBAC9C,OAAO,YAAY,YACnB;AACA,YAAQ,QAAS,MAAgC,QAAQ;AAAA,EAC3D;AACA,MAAI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B;AAGjD,QAAI,gBAAgB,WAAY,QAAO;AAEvC,WACE,4CAAC,SAAI,WAAU,mDACb;AAAA,MAAC,wBAAwB;AAAA,MAAxB;AAAA,QACC;AAAA,QACA,eAAW;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,QACC,GAAG;AAAA;AAAA,IACN,GACF;AAAA,EAEJ;AACF;AACA,uBAAuB,cAAc;","names":["renderContent"]}
@@ -11,6 +11,16 @@ function ChevronDownIcon({ className }) {
11
11
  function ChevronRightIcon({ className }) {
12
12
  return /* @__PURE__ */ jsx("svg", { className, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) });
13
13
  }
14
+ const REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
15
+ function renderInsideChild(children, render) {
16
+ let child = children;
17
+ const resolve = React.use;
18
+ if (typeof child === "object" && child !== null && child.$$typeof === REACT_LAZY_TYPE && typeof resolve === "function") {
19
+ child = resolve(child._payload);
20
+ }
21
+ if (!React.isValidElement(child)) return render(children);
22
+ return React.cloneElement(child, void 0, render(child.props.children));
23
+ }
14
24
  const contentRadiusMap = {
15
25
  sm: "rounded",
16
26
  // 4px
@@ -374,8 +384,14 @@ const NavigationMenuLink = React.forwardRef(
374
384
  );
375
385
  }
376
386
  const Comp = asChild ? Slot : "a";
387
+ const iconNode = icon && /* @__PURE__ */ jsx("span", { className: cn("shrink-0", s.icon), children: icon });
388
+ const childText = asChild && React.isValidElement(children) ? children.props.children : children;
377
389
  if (inContent) {
378
- return /* @__PURE__ */ jsxs(
390
+ const renderContent2 = (content) => /* @__PURE__ */ jsxs(Fragment, { children: [
391
+ iconNode,
392
+ !collapsed && content
393
+ ] });
394
+ return /* @__PURE__ */ jsx(
379
395
  Comp,
380
396
  {
381
397
  ref,
@@ -391,14 +407,15 @@ const NavigationMenuLink = React.forwardRef(
391
407
  ),
392
408
  ...active ? { "aria-current": "page" } : {},
393
409
  ...props,
394
- children: [
395
- icon && /* @__PURE__ */ jsx("span", { className: cn("shrink-0", s.icon), children: icon }),
396
- !collapsed && children
397
- ]
410
+ children: asChild ? renderInsideChild(children, renderContent2) : renderContent2(children)
398
411
  }
399
412
  );
400
413
  }
401
- return /* @__PURE__ */ jsxs(
414
+ const renderContent = (content) => /* @__PURE__ */ jsxs(Fragment, { children: [
415
+ iconNode,
416
+ !collapsed && /* @__PURE__ */ jsx("span", { className: "truncate", children: content })
417
+ ] });
418
+ return /* @__PURE__ */ jsx(
402
419
  Comp,
403
420
  {
404
421
  ref,
@@ -413,12 +430,9 @@ const NavigationMenuLink = React.forwardRef(
413
430
  className
414
431
  ),
415
432
  ...active ? { "aria-current": "page" } : {},
416
- ...collapsed && typeof children === "string" ? { title: children } : {},
433
+ ...collapsed && typeof childText === "string" ? { title: childText } : {},
417
434
  ...props,
418
- children: [
419
- icon && /* @__PURE__ */ jsx("span", { className: cn("shrink-0", s.icon), children: icon }),
420
- !collapsed && /* @__PURE__ */ jsx("span", { className: "truncate", children })
421
- ]
435
+ children: asChild ? renderInsideChild(children, renderContent) : renderContent(children)
422
436
  }
423
437
  );
424
438
  }