@karakuri-ui/react 0.2.3 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. package/README.md +0 -1
  2. package/dist/components/ui/accordion.d.mts +40 -0
  3. package/dist/components/ui/accordion.d.ts +40 -0
  4. package/dist/components/ui/accordion.js +215 -0
  5. package/dist/components/ui/accordion.js.map +1 -0
  6. package/dist/components/ui/accordion.mjs +176 -0
  7. package/dist/components/ui/accordion.mjs.map +1 -0
  8. package/dist/components/ui/alert.d.mts +38 -0
  9. package/dist/components/ui/alert.d.ts +38 -0
  10. package/dist/components/ui/alert.js +217 -0
  11. package/dist/components/ui/alert.js.map +1 -0
  12. package/dist/components/ui/alert.mjs +180 -0
  13. package/dist/components/ui/alert.mjs.map +1 -0
  14. package/dist/components/ui/avatar.d.mts +223 -0
  15. package/dist/components/ui/avatar.d.ts +223 -0
  16. package/dist/components/ui/avatar.js +245 -0
  17. package/dist/components/ui/avatar.js.map +1 -0
  18. package/dist/components/ui/avatar.mjs +204 -0
  19. package/dist/components/ui/avatar.mjs.map +1 -0
  20. package/dist/components/ui/badge.d.mts +31 -0
  21. package/dist/components/ui/badge.d.ts +31 -0
  22. package/dist/components/ui/badge.js +205 -0
  23. package/dist/components/ui/badge.js.map +1 -0
  24. package/dist/components/ui/badge.mjs +170 -0
  25. package/dist/components/ui/badge.mjs.map +1 -0
  26. package/dist/components/ui/breadcrumb.d.mts +46 -0
  27. package/dist/components/ui/breadcrumb.d.ts +46 -0
  28. package/dist/components/ui/breadcrumb.js +201 -0
  29. package/dist/components/ui/breadcrumb.js.map +1 -0
  30. package/dist/components/ui/breadcrumb.mjs +160 -0
  31. package/dist/components/ui/breadcrumb.mjs.map +1 -0
  32. package/dist/components/ui/button-group.d.mts +22 -0
  33. package/dist/components/ui/button-group.d.ts +22 -0
  34. package/dist/components/ui/button-group.js +107 -0
  35. package/dist/components/ui/button-group.js.map +1 -0
  36. package/dist/components/ui/button-group.mjs +72 -0
  37. package/dist/components/ui/button-group.mjs.map +1 -0
  38. package/dist/components/ui/button.d.mts +31 -0
  39. package/dist/components/ui/button.d.ts +31 -0
  40. package/dist/components/ui/button.js +176 -0
  41. package/dist/components/ui/button.js.map +1 -0
  42. package/dist/components/ui/button.mjs +141 -0
  43. package/dist/components/ui/button.mjs.map +1 -0
  44. package/dist/components/ui/card.d.mts +60 -0
  45. package/dist/components/ui/card.d.ts +60 -0
  46. package/dist/components/ui/card.js +361 -0
  47. package/dist/components/ui/card.js.map +1 -0
  48. package/dist/components/ui/card.mjs +319 -0
  49. package/dist/components/ui/card.mjs.map +1 -0
  50. package/dist/{chart.d.mts → components/ui/chart.d.mts} +2 -18
  51. package/dist/{chart.d.ts → components/ui/chart.d.ts} +2 -18
  52. package/dist/{chart.js → components/ui/chart.js} +30 -55
  53. package/dist/components/ui/chart.js.map +1 -0
  54. package/dist/{chart.mjs → components/ui/chart.mjs} +22 -46
  55. package/dist/components/ui/chart.mjs.map +1 -0
  56. package/dist/components/ui/checkbox.d.mts +24 -0
  57. package/dist/components/ui/checkbox.d.ts +24 -0
  58. package/dist/components/ui/checkbox.js +173 -0
  59. package/dist/components/ui/checkbox.js.map +1 -0
  60. package/dist/components/ui/checkbox.mjs +138 -0
  61. package/dist/components/ui/checkbox.mjs.map +1 -0
  62. package/dist/components/ui/divider.d.mts +27 -0
  63. package/dist/components/ui/divider.d.ts +27 -0
  64. package/dist/components/ui/divider.js +147 -0
  65. package/dist/components/ui/divider.js.map +1 -0
  66. package/dist/components/ui/divider.mjs +112 -0
  67. package/dist/components/ui/divider.mjs.map +1 -0
  68. package/dist/components/ui/drawer.d.mts +36 -0
  69. package/dist/components/ui/drawer.d.ts +36 -0
  70. package/dist/components/ui/drawer.js +211 -0
  71. package/dist/components/ui/drawer.js.map +1 -0
  72. package/dist/components/ui/drawer.mjs +165 -0
  73. package/dist/components/ui/drawer.mjs.map +1 -0
  74. package/dist/components/ui/dropdown.d.mts +34 -0
  75. package/dist/components/ui/dropdown.d.ts +34 -0
  76. package/dist/components/ui/dropdown.js +295 -0
  77. package/dist/components/ui/dropdown.js.map +1 -0
  78. package/dist/components/ui/dropdown.mjs +248 -0
  79. package/dist/components/ui/dropdown.mjs.map +1 -0
  80. package/dist/components/ui/field.d.mts +26 -0
  81. package/dist/components/ui/field.d.ts +26 -0
  82. package/dist/components/ui/field.js +141 -0
  83. package/dist/components/ui/field.js.map +1 -0
  84. package/dist/components/ui/field.mjs +103 -0
  85. package/dist/components/ui/field.mjs.map +1 -0
  86. package/dist/components/ui/icon-button.d.mts +20 -0
  87. package/dist/components/ui/icon-button.d.ts +20 -0
  88. package/dist/components/ui/icon-button.js +147 -0
  89. package/dist/components/ui/icon-button.js.map +1 -0
  90. package/dist/components/ui/icon-button.mjs +112 -0
  91. package/dist/components/ui/icon-button.mjs.map +1 -0
  92. package/dist/components/ui/index.d.mts +55 -0
  93. package/dist/components/ui/index.d.ts +55 -0
  94. package/dist/components/ui/index.js +468 -0
  95. package/dist/components/ui/index.js.map +1 -0
  96. package/dist/components/ui/index.mjs +242 -0
  97. package/dist/components/ui/index.mjs.map +1 -0
  98. package/dist/components/ui/input.d.mts +20 -0
  99. package/dist/components/ui/input.d.ts +20 -0
  100. package/dist/components/ui/input.js +250 -0
  101. package/dist/components/ui/input.js.map +1 -0
  102. package/dist/components/ui/input.mjs +215 -0
  103. package/dist/components/ui/input.mjs.map +1 -0
  104. package/dist/components/ui/metric-card.d.mts +38 -0
  105. package/dist/components/ui/metric-card.d.ts +38 -0
  106. package/dist/components/ui/metric-card.js +250 -0
  107. package/dist/components/ui/metric-card.js.map +1 -0
  108. package/dist/components/ui/metric-card.mjs +209 -0
  109. package/dist/components/ui/metric-card.mjs.map +1 -0
  110. package/dist/components/ui/modal.d.mts +47 -0
  111. package/dist/components/ui/modal.d.ts +47 -0
  112. package/dist/components/ui/modal.js +371 -0
  113. package/dist/components/ui/modal.js.map +1 -0
  114. package/dist/components/ui/modal.mjs +313 -0
  115. package/dist/components/ui/modal.mjs.map +1 -0
  116. package/dist/components/ui/navigation-menu.d.mts +120 -0
  117. package/dist/components/ui/navigation-menu.d.ts +120 -0
  118. package/dist/components/ui/navigation-menu.js +521 -0
  119. package/dist/components/ui/navigation-menu.js.map +1 -0
  120. package/dist/components/ui/navigation-menu.mjs +478 -0
  121. package/dist/components/ui/navigation-menu.mjs.map +1 -0
  122. package/dist/components/ui/pagination.d.mts +113 -0
  123. package/dist/components/ui/pagination.d.ts +113 -0
  124. package/dist/components/ui/pagination.js +484 -0
  125. package/dist/components/ui/pagination.js.map +1 -0
  126. package/dist/components/ui/pagination.mjs +438 -0
  127. package/dist/components/ui/pagination.mjs.map +1 -0
  128. package/dist/components/ui/popover.d.mts +29 -0
  129. package/dist/components/ui/popover.d.ts +29 -0
  130. package/dist/components/ui/popover.js +165 -0
  131. package/dist/components/ui/popover.js.map +1 -0
  132. package/dist/components/ui/popover.mjs +124 -0
  133. package/dist/components/ui/popover.mjs.map +1 -0
  134. package/dist/components/ui/progress.d.mts +35 -0
  135. package/dist/components/ui/progress.d.ts +35 -0
  136. package/dist/components/ui/progress.js +194 -0
  137. package/dist/components/ui/progress.js.map +1 -0
  138. package/dist/components/ui/progress.mjs +159 -0
  139. package/dist/components/ui/progress.mjs.map +1 -0
  140. package/dist/components/ui/radio-group.d.mts +35 -0
  141. package/dist/components/ui/radio-group.d.ts +35 -0
  142. package/dist/components/ui/radio-group.js +174 -0
  143. package/dist/components/ui/radio-group.js.map +1 -0
  144. package/dist/components/ui/radio-group.mjs +137 -0
  145. package/dist/components/ui/radio-group.mjs.map +1 -0
  146. package/dist/components/ui/segmented.d.mts +25 -0
  147. package/dist/components/ui/segmented.d.ts +25 -0
  148. package/dist/components/ui/segmented.js +238 -0
  149. package/dist/components/ui/segmented.js.map +1 -0
  150. package/dist/components/ui/segmented.mjs +201 -0
  151. package/dist/components/ui/segmented.mjs.map +1 -0
  152. package/dist/components/ui/select.d.mts +20 -0
  153. package/dist/components/ui/select.d.ts +20 -0
  154. package/dist/components/ui/select.js +308 -0
  155. package/dist/components/ui/select.js.map +1 -0
  156. package/dist/components/ui/select.mjs +267 -0
  157. package/dist/components/ui/select.mjs.map +1 -0
  158. package/dist/components/ui/skeleton.d.mts +26 -0
  159. package/dist/components/ui/skeleton.d.ts +26 -0
  160. package/dist/components/ui/skeleton.js +144 -0
  161. package/dist/components/ui/skeleton.js.map +1 -0
  162. package/dist/components/ui/skeleton.mjs +109 -0
  163. package/dist/components/ui/skeleton.mjs.map +1 -0
  164. package/dist/components/ui/slider.d.mts +38 -0
  165. package/dist/components/ui/slider.d.ts +38 -0
  166. package/dist/components/ui/slider.js +180 -0
  167. package/dist/components/ui/slider.js.map +1 -0
  168. package/dist/components/ui/slider.mjs +145 -0
  169. package/dist/components/ui/slider.mjs.map +1 -0
  170. package/dist/components/ui/spinner.d.mts +23 -0
  171. package/dist/components/ui/spinner.d.ts +23 -0
  172. package/dist/components/ui/spinner.js +471 -0
  173. package/dist/components/ui/spinner.js.map +1 -0
  174. package/dist/components/ui/spinner.mjs +436 -0
  175. package/dist/components/ui/spinner.mjs.map +1 -0
  176. package/dist/components/ui/switch.d.mts +22 -0
  177. package/dist/components/ui/switch.d.ts +22 -0
  178. package/dist/components/ui/switch.js +173 -0
  179. package/dist/components/ui/switch.js.map +1 -0
  180. package/dist/components/ui/switch.mjs +138 -0
  181. package/dist/components/ui/switch.mjs.map +1 -0
  182. package/dist/components/ui/table.d.mts +60 -0
  183. package/dist/components/ui/table.d.ts +60 -0
  184. package/dist/components/ui/table.js +231 -0
  185. package/dist/components/ui/table.js.map +1 -0
  186. package/dist/components/ui/table.mjs +190 -0
  187. package/dist/components/ui/table.mjs.map +1 -0
  188. package/dist/components/ui/tabs.d.mts +31 -0
  189. package/dist/components/ui/tabs.d.ts +31 -0
  190. package/dist/components/ui/tabs.js +233 -0
  191. package/dist/components/ui/tabs.js.map +1 -0
  192. package/dist/components/ui/tabs.mjs +194 -0
  193. package/dist/components/ui/tabs.mjs.map +1 -0
  194. package/dist/components/ui/textarea.d.mts +19 -0
  195. package/dist/components/ui/textarea.d.ts +19 -0
  196. package/dist/components/ui/textarea.js +181 -0
  197. package/dist/components/ui/textarea.js.map +1 -0
  198. package/dist/components/ui/textarea.mjs +146 -0
  199. package/dist/components/ui/textarea.mjs.map +1 -0
  200. package/dist/components/ui/toast.d.mts +93 -0
  201. package/dist/components/ui/toast.d.ts +93 -0
  202. package/dist/components/ui/toast.js +429 -0
  203. package/dist/components/ui/toast.js.map +1 -0
  204. package/dist/components/ui/toast.mjs +393 -0
  205. package/dist/components/ui/toast.mjs.map +1 -0
  206. package/dist/components/ui/toggle-group.d.mts +42 -0
  207. package/dist/components/ui/toggle-group.d.ts +42 -0
  208. package/dist/components/ui/toggle-group.js +183 -0
  209. package/dist/components/ui/toggle-group.js.map +1 -0
  210. package/dist/components/ui/toggle-group.mjs +146 -0
  211. package/dist/components/ui/toggle-group.mjs.map +1 -0
  212. package/dist/components/ui/toggle.d.mts +19 -0
  213. package/dist/components/ui/toggle.d.ts +19 -0
  214. package/dist/components/ui/toggle.js +194 -0
  215. package/dist/components/ui/toggle.js.map +1 -0
  216. package/dist/components/ui/toggle.mjs +159 -0
  217. package/dist/components/ui/toggle.mjs.map +1 -0
  218. package/dist/components/ui/tooltip.d.mts +26 -0
  219. package/dist/components/ui/tooltip.d.ts +26 -0
  220. package/dist/components/ui/tooltip.js +128 -0
  221. package/dist/components/ui/tooltip.js.map +1 -0
  222. package/dist/components/ui/tooltip.mjs +88 -0
  223. package/dist/components/ui/tooltip.mjs.map +1 -0
  224. package/dist/lib/code-generator.d.mts +60 -0
  225. package/dist/lib/code-generator.d.ts +60 -0
  226. package/dist/lib/code-generator.js +224 -0
  227. package/dist/lib/code-generator.js.map +1 -0
  228. package/dist/lib/code-generator.mjs +159 -0
  229. package/dist/lib/code-generator.mjs.map +1 -0
  230. package/dist/lib/utils.d.mts +10 -0
  231. package/dist/lib/utils.d.ts +10 -0
  232. package/dist/lib/utils.js +33 -0
  233. package/dist/lib/utils.js.map +1 -0
  234. package/dist/lib/utils.mjs +9 -0
  235. package/dist/lib/utils.mjs.map +1 -0
  236. package/package.json +11 -11
  237. package/dist/chart.js.map +0 -1
  238. package/dist/chart.mjs.map +0 -1
  239. package/dist/index.d.mts +0 -1636
  240. package/dist/index.d.ts +0 -1636
  241. package/dist/index.js +0 -7291
  242. package/dist/index.js.map +0 -1
  243. package/dist/index.mjs +0 -7048
  244. package/dist/index.mjs.map +0 -1
@@ -0,0 +1,478 @@
1
+ "use client";
2
+ import * as React from "react";
3
+ import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
4
+ import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
5
+ import { Slot } from "@radix-ui/react-slot";
6
+ import { cn } from "../../lib/utils";
7
+ function ChevronDownIcon({ className }) {
8
+ return /* @__PURE__ */ React.createElement("svg", { className, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, "aria-hidden": "true" }, /* @__PURE__ */ React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }));
9
+ }
10
+ function ChevronRightIcon({ className }) {
11
+ return /* @__PURE__ */ React.createElement("svg", { className, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, "aria-hidden": "true" }, /* @__PURE__ */ React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }));
12
+ }
13
+ const contentRadiusMap = {
14
+ sm: "rounded",
15
+ // 4px
16
+ md: "rounded-md",
17
+ // 6px
18
+ lg: "rounded-lg",
19
+ // 8px
20
+ xl: "rounded-xl"
21
+ // 12px
22
+ };
23
+ const itemRadiusMap = {
24
+ sm: "rounded-sm",
25
+ // 2px
26
+ md: "rounded",
27
+ // 4px
28
+ lg: "rounded-md",
29
+ // 6px
30
+ xl: "rounded-lg"
31
+ // 8px
32
+ };
33
+ const NavigationMenuContext = React.createContext({
34
+ orientation: "horizontal",
35
+ size: "default",
36
+ collapsed: false,
37
+ radius: "lg",
38
+ fontWeight: "normal"
39
+ });
40
+ const useNavigationMenuContext = () => React.useContext(NavigationMenuContext);
41
+ const ContentLevelContext = React.createContext(false);
42
+ const navigationMenuSizeMap = {
43
+ sm: {
44
+ trigger: "h-8 text-sm px-3 gap-2",
45
+ link: "h-8 text-sm px-3 gap-2",
46
+ icon: "icon-xs",
47
+ collapsedSquare: "size-8",
48
+ collapsedWidth: 56,
49
+ dropdownLink: "px-3 py-1.5 text-sm gap-2",
50
+ subLink: "h-8 text-sm pl-8 pr-3 gap-2",
51
+ groupLabel: "text-2xs px-3 mb-1",
52
+ groupMargin: "mt-4 first:mt-0"
53
+ },
54
+ md: {
55
+ trigger: "h-9 text-md px-3.5 gap-2",
56
+ link: "h-9 text-md px-3.5 gap-2",
57
+ icon: "icon-sm",
58
+ collapsedSquare: "size-9",
59
+ collapsedWidth: 60,
60
+ dropdownLink: "px-3 py-1.5 text-md gap-2",
61
+ subLink: "h-9 text-md pl-9 pr-3.5 gap-2",
62
+ groupLabel: "text-xs px-3.5 mb-1",
63
+ groupMargin: "mt-4 first:mt-0"
64
+ },
65
+ default: {
66
+ trigger: "h-10 text-md px-4 gap-2",
67
+ link: "h-10 text-md px-4 gap-2",
68
+ icon: "icon-sm",
69
+ collapsedSquare: "size-10",
70
+ collapsedWidth: 64,
71
+ dropdownLink: "px-3 py-2 text-md gap-2",
72
+ subLink: "h-10 text-md pl-10 pr-4 gap-2",
73
+ groupLabel: "text-xs px-4 mb-1.5",
74
+ groupMargin: "mt-5 first:mt-0"
75
+ },
76
+ lg: {
77
+ trigger: "h-12 text-base px-6 gap-2",
78
+ link: "h-12 text-base px-6 gap-2",
79
+ icon: "icon-sm",
80
+ collapsedSquare: "size-12",
81
+ collapsedWidth: 72,
82
+ dropdownLink: "px-3 py-2.5 text-base gap-2",
83
+ subLink: "h-12 text-base pl-12 pr-6 gap-2",
84
+ groupLabel: "text-xs px-4 mb-2",
85
+ groupMargin: "mt-6 first:mt-0"
86
+ }
87
+ };
88
+ const NavigationMenu = React.forwardRef(
89
+ ({
90
+ className,
91
+ orientation = "horizontal",
92
+ size = "default",
93
+ collapsed = false,
94
+ width,
95
+ collapsedWidth,
96
+ radius = "lg",
97
+ fontWeight = "normal",
98
+ delayDuration = 200,
99
+ skipDelayDuration = 300,
100
+ value,
101
+ defaultValue,
102
+ onValueChange,
103
+ children,
104
+ style,
105
+ ...props
106
+ }, ref) => {
107
+ const contextValue = React.useMemo(
108
+ () => ({ orientation, size, collapsed: orientation === "vertical" ? collapsed : false, radius, fontWeight }),
109
+ [orientation, size, collapsed, radius, fontWeight]
110
+ );
111
+ if (orientation === "horizontal") {
112
+ return /* @__PURE__ */ React.createElement(NavigationMenuContext.Provider, { value: contextValue }, /* @__PURE__ */ React.createElement(
113
+ NavigationMenuPrimitive.Root,
114
+ {
115
+ ref,
116
+ className: cn("relative", className),
117
+ delayDuration,
118
+ skipDelayDuration,
119
+ value,
120
+ defaultValue: defaultValue ?? "",
121
+ onValueChange
122
+ },
123
+ children
124
+ ));
125
+ }
126
+ const resolvedWidth = collapsed ? collapsedWidth ?? navigationMenuSizeMap[size].collapsedWidth : width ?? 256;
127
+ const widthValue = typeof resolvedWidth === "number" ? `${resolvedWidth}px` : resolvedWidth;
128
+ return /* @__PURE__ */ React.createElement(NavigationMenuContext.Provider, { value: contextValue }, /* @__PURE__ */ React.createElement(
129
+ "nav",
130
+ {
131
+ ref,
132
+ "aria-label": "navigation",
133
+ className: cn(
134
+ "flex flex-col",
135
+ "transition-[width] duration-normal ease-out",
136
+ className
137
+ ),
138
+ style: { width: widthValue, ...style },
139
+ ...props
140
+ },
141
+ children
142
+ ));
143
+ }
144
+ );
145
+ NavigationMenu.displayName = "NavigationMenu";
146
+ const NavigationMenuList = React.forwardRef(
147
+ ({ className, children, ...props }, ref) => {
148
+ const { orientation } = useNavigationMenuContext();
149
+ if (orientation === "horizontal") {
150
+ return /* @__PURE__ */ React.createElement(
151
+ NavigationMenuPrimitive.List,
152
+ {
153
+ ref,
154
+ className: cn("flex items-center gap-1", className),
155
+ ...props
156
+ },
157
+ children
158
+ );
159
+ }
160
+ return /* @__PURE__ */ React.createElement(
161
+ "ul",
162
+ {
163
+ ref,
164
+ className: cn("flex flex-col gap-0.5", className),
165
+ ...props
166
+ },
167
+ children
168
+ );
169
+ }
170
+ );
171
+ NavigationMenuList.displayName = "NavigationMenuList";
172
+ const NavigationMenuItem = React.forwardRef(
173
+ ({ className, value, defaultOpen = false, children, ...props }, ref) => {
174
+ const { orientation, collapsed } = useNavigationMenuContext();
175
+ const [open, setOpen] = React.useState(defaultOpen);
176
+ React.useEffect(() => {
177
+ if (collapsed) setOpen(false);
178
+ }, [collapsed]);
179
+ if (orientation === "horizontal") {
180
+ return /* @__PURE__ */ React.createElement(
181
+ NavigationMenuPrimitive.Item,
182
+ {
183
+ ref,
184
+ className: cn("relative", className),
185
+ value,
186
+ ...props
187
+ },
188
+ children
189
+ );
190
+ }
191
+ return /* @__PURE__ */ React.createElement(
192
+ CollapsiblePrimitive.Root,
193
+ {
194
+ open: collapsed ? false : open,
195
+ onOpenChange: collapsed ? void 0 : setOpen,
196
+ asChild: true
197
+ },
198
+ /* @__PURE__ */ React.createElement("li", { ref, className: cn("", className), ...props }, children)
199
+ );
200
+ }
201
+ );
202
+ NavigationMenuItem.displayName = "NavigationMenuItem";
203
+ const NavigationMenuTrigger = React.forwardRef(
204
+ ({ className, children, icon, chevronIcon, ...props }, ref) => {
205
+ const { orientation, size, collapsed, radius, fontWeight: fw } = useNavigationMenuContext();
206
+ const s = navigationMenuSizeMap[size];
207
+ const fwClass = fw === "semibold" ? "font-semibold" : "font-normal";
208
+ if (orientation === "horizontal") {
209
+ return /* @__PURE__ */ React.createElement(
210
+ NavigationMenuPrimitive.Trigger,
211
+ {
212
+ ref,
213
+ className: cn(
214
+ "group inline-flex items-center justify-center",
215
+ s.trigger,
216
+ "gap-0",
217
+ fwClass,
218
+ "text-text-muted",
219
+ "transition-colors duration-fast",
220
+ "hover:text-foreground",
221
+ "data-[state=open]:text-foreground",
222
+ "focus-visible:focus-ring",
223
+ "disabled:pointer-events-none disabled:opacity-50",
224
+ className
225
+ ),
226
+ ...props
227
+ },
228
+ icon && /* @__PURE__ */ React.createElement("span", { className: cn("shrink-0 mr-2", s.icon) }, icon),
229
+ children,
230
+ /* @__PURE__ */ React.createElement("span", { className: cn("shrink-0 ml-1 text-text-subtle transition-transform duration-fast group-data-[state=open]:rotate-180", s.icon) }, chevronIcon ?? /* @__PURE__ */ React.createElement(ChevronDownIcon, { className: "size-full" }))
231
+ );
232
+ }
233
+ return /* @__PURE__ */ React.createElement(
234
+ CollapsiblePrimitive.Trigger,
235
+ {
236
+ ref,
237
+ className: cn(
238
+ "group flex items-center cursor-pointer",
239
+ contentRadiusMap[radius],
240
+ collapsed ? [s.collapsedSquare, "justify-center mx-auto"] : ["w-full", s.trigger],
241
+ fwClass,
242
+ "text-text-muted transition-colors duration-fast",
243
+ "hover:text-foreground hover:bg-background-muted",
244
+ !collapsed && "data-[state=open]:text-foreground",
245
+ "focus-visible:focus-ring",
246
+ "disabled:pointer-events-none disabled:opacity-50",
247
+ className
248
+ ),
249
+ ...collapsed && typeof children === "string" ? { title: children } : {},
250
+ ...props
251
+ },
252
+ icon && /* @__PURE__ */ React.createElement("span", { className: cn("shrink-0", s.icon) }, icon),
253
+ !collapsed && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("span", { className: "flex-1 text-left truncate" }, children), /* @__PURE__ */ React.createElement(
254
+ "span",
255
+ {
256
+ className: cn(
257
+ "shrink-0 text-text-subtle transition-transform duration-normal",
258
+ s.icon,
259
+ "group-data-[state=open]:rotate-90"
260
+ )
261
+ },
262
+ chevronIcon ?? /* @__PURE__ */ React.createElement(ChevronRightIcon, { className: "size-full" })
263
+ ))
264
+ );
265
+ }
266
+ );
267
+ NavigationMenuTrigger.displayName = "NavigationMenuTrigger";
268
+ const NavigationMenuContent = React.forwardRef(
269
+ ({ className, children, ...props }, ref) => {
270
+ const { orientation, size, collapsed, radius } = useNavigationMenuContext();
271
+ const s = navigationMenuSizeMap[size];
272
+ if (orientation === "horizontal") {
273
+ return /* @__PURE__ */ React.createElement(ContentLevelContext.Provider, { value: true }, /* @__PURE__ */ React.createElement(
274
+ NavigationMenuPrimitive.Content,
275
+ {
276
+ ref,
277
+ className: cn(
278
+ "absolute left-0 top-full z-dropdown pt-1",
279
+ "data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out",
280
+ className
281
+ ),
282
+ ...props
283
+ },
284
+ /* @__PURE__ */ React.createElement("div", { className: cn("min-w-[180px] border border-border bg-background shadow-lg p-1.5 grid gap-0.5", contentRadiusMap[radius]) }, children)
285
+ ));
286
+ }
287
+ if (collapsed) return null;
288
+ return /* @__PURE__ */ React.createElement(ContentLevelContext.Provider, { value: true }, /* @__PURE__ */ React.createElement(
289
+ CollapsiblePrimitive.Content,
290
+ {
291
+ ref,
292
+ className: cn(
293
+ "overflow-hidden",
294
+ "data-[state=open]:animate-collapsible-down data-[state=closed]:animate-collapsible-up"
295
+ ),
296
+ ...props
297
+ },
298
+ /* @__PURE__ */ React.createElement("div", { className: cn(
299
+ "flex flex-col gap-0.5 py-1",
300
+ className
301
+ ) }, children)
302
+ ));
303
+ }
304
+ );
305
+ NavigationMenuContent.displayName = "NavigationMenuContent";
306
+ const NavigationMenuLink = React.forwardRef(
307
+ ({ className, active, asChild, icon, children, ...props }, ref) => {
308
+ const { orientation, size, collapsed, radius, fontWeight: fw } = useNavigationMenuContext();
309
+ const s = navigationMenuSizeMap[size];
310
+ const fwClass = fw === "semibold" ? "font-semibold" : "font-normal";
311
+ const inContent = React.useContext(ContentLevelContext);
312
+ if (orientation === "horizontal") {
313
+ const { onSelect, ...radixSafeProps } = props;
314
+ if (inContent) {
315
+ return /* @__PURE__ */ React.createElement(
316
+ NavigationMenuPrimitive.Link,
317
+ {
318
+ ref,
319
+ className: cn(
320
+ "flex items-center w-full",
321
+ s.dropdownLink,
322
+ itemRadiusMap[radius],
323
+ "text-text-muted transition-colors duration-fast",
324
+ "hover:text-foreground hover:bg-background-muted",
325
+ active && "text-foreground bg-background-muted font-semibold",
326
+ "focus-visible:focus-ring",
327
+ className
328
+ ),
329
+ active,
330
+ asChild,
331
+ onSelect,
332
+ ...radixSafeProps
333
+ },
334
+ asChild ? children : /* @__PURE__ */ React.createElement(React.Fragment, null, icon && /* @__PURE__ */ React.createElement("span", { className: cn("shrink-0", s.icon) }, icon), children)
335
+ );
336
+ }
337
+ return /* @__PURE__ */ React.createElement(
338
+ NavigationMenuPrimitive.Link,
339
+ {
340
+ ref,
341
+ className: cn(
342
+ "inline-flex items-center justify-center",
343
+ s.link,
344
+ fwClass,
345
+ "text-text-muted",
346
+ "transition-colors duration-fast",
347
+ "hover:text-foreground",
348
+ active && "text-foreground font-semibold",
349
+ "focus-visible:focus-ring",
350
+ className
351
+ ),
352
+ active,
353
+ asChild,
354
+ onSelect,
355
+ ...radixSafeProps
356
+ },
357
+ asChild ? children : /* @__PURE__ */ React.createElement(React.Fragment, null, icon && /* @__PURE__ */ React.createElement("span", { className: cn("shrink-0", s.icon) }, icon), children)
358
+ );
359
+ }
360
+ const Comp = asChild ? Slot : "a";
361
+ if (inContent) {
362
+ return /* @__PURE__ */ React.createElement(
363
+ Comp,
364
+ {
365
+ ref,
366
+ className: cn(
367
+ "flex items-center w-full cursor-pointer",
368
+ contentRadiusMap[radius],
369
+ s.subLink,
370
+ "text-text-muted transition-colors duration-fast",
371
+ "hover:text-foreground hover:bg-background-muted",
372
+ active && "text-foreground bg-background-muted font-semibold",
373
+ "focus-visible:focus-ring",
374
+ className
375
+ ),
376
+ ...active ? { "aria-current": "page" } : {},
377
+ ...props
378
+ },
379
+ icon && /* @__PURE__ */ React.createElement("span", { className: cn("shrink-0", s.icon) }, icon),
380
+ !collapsed && children
381
+ );
382
+ }
383
+ return /* @__PURE__ */ React.createElement(
384
+ Comp,
385
+ {
386
+ ref,
387
+ className: cn(
388
+ "relative flex items-center cursor-pointer",
389
+ contentRadiusMap[radius],
390
+ collapsed ? [s.collapsedSquare, "justify-center mx-auto"] : ["w-full", s.link],
391
+ "text-text-muted transition-colors duration-fast",
392
+ "hover:text-foreground hover:bg-background-muted",
393
+ active && "text-foreground bg-background-muted font-semibold",
394
+ "focus-visible:focus-ring",
395
+ className
396
+ ),
397
+ ...active ? { "aria-current": "page" } : {},
398
+ ...collapsed && typeof children === "string" ? { title: children } : {},
399
+ ...props
400
+ },
401
+ icon && /* @__PURE__ */ React.createElement("span", { className: cn("shrink-0", s.icon) }, icon),
402
+ !collapsed && /* @__PURE__ */ React.createElement("span", { className: "truncate" }, children)
403
+ );
404
+ }
405
+ );
406
+ NavigationMenuLink.displayName = "NavigationMenuLink";
407
+ const NavigationMenuGroup = React.forwardRef(
408
+ ({ className, label, children, ...props }, ref) => {
409
+ const { size, collapsed } = useNavigationMenuContext();
410
+ const s = navigationMenuSizeMap[size];
411
+ return /* @__PURE__ */ React.createElement("div", { ref, role: "group", className: cn(label && !collapsed && s.groupMargin, className), ...props }, label && !collapsed && /* @__PURE__ */ React.createElement("div", { className: cn(
412
+ "font-semibold text-text-subtle uppercase tracking-wider select-none",
413
+ s.groupLabel
414
+ ) }, label), /* @__PURE__ */ React.createElement("ul", { className: "flex flex-col gap-0.5" }, children));
415
+ }
416
+ );
417
+ NavigationMenuGroup.displayName = "NavigationMenuGroup";
418
+ const NavigationMenuIndicator = React.forwardRef(
419
+ ({ className, color = "default", ...props }, ref) => {
420
+ const { orientation } = useNavigationMenuContext();
421
+ if (orientation === "vertical") return null;
422
+ return /* @__PURE__ */ React.createElement(
423
+ NavigationMenuPrimitive.Indicator,
424
+ {
425
+ ref,
426
+ className: cn(
427
+ "z-10 flex h-[3px] items-end justify-center overflow-hidden",
428
+ "transition-[width,transform] duration-normal ease-out",
429
+ "data-[state=visible]:animate-fade-in data-[state=hidden]:animate-fade-out",
430
+ className
431
+ ),
432
+ ...props
433
+ },
434
+ /* @__PURE__ */ React.createElement("div", { className: cn(
435
+ "relative h-full w-full rounded-full",
436
+ color === "default" ? "bg-foreground" : "bg-primary"
437
+ ) })
438
+ );
439
+ }
440
+ );
441
+ NavigationMenuIndicator.displayName = "NavigationMenuIndicator";
442
+ const NavigationMenuViewport = React.forwardRef(
443
+ ({ className, ...props }, ref) => {
444
+ const { orientation } = useNavigationMenuContext();
445
+ if (orientation === "vertical") return null;
446
+ return /* @__PURE__ */ React.createElement("div", { className: "absolute left-0 top-full z-dropdown w-auto pt-1" }, /* @__PURE__ */ React.createElement(
447
+ NavigationMenuPrimitive.Viewport,
448
+ {
449
+ ref,
450
+ className: cn(
451
+ "relative overflow-hidden",
452
+ "border border-border bg-background rounded-xl shadow-lg",
453
+ "h-[var(--radix-navigation-menu-viewport-height)]",
454
+ "w-[var(--radix-navigation-menu-viewport-width)]",
455
+ "transition-[width,height] duration-fast ease-out",
456
+ "data-[state=open]:animate-nav-viewport-enter",
457
+ "data-[state=closed]:animate-nav-viewport-exit",
458
+ className
459
+ ),
460
+ ...props
461
+ }
462
+ ));
463
+ }
464
+ );
465
+ NavigationMenuViewport.displayName = "NavigationMenuViewport";
466
+ export {
467
+ NavigationMenu,
468
+ NavigationMenuContent,
469
+ NavigationMenuGroup,
470
+ NavigationMenuIndicator,
471
+ NavigationMenuItem,
472
+ NavigationMenuLink,
473
+ NavigationMenuList,
474
+ NavigationMenuTrigger,
475
+ NavigationMenuViewport,
476
+ navigationMenuSizeMap
477
+ };
478
+ //# sourceMappingURL=navigation-menu.mjs.map
@@ -0,0 +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\n React.useEffect(() => {\n if (collapsed) setOpen(false)\n }, [collapsed])\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 return (\n <div ref={ref} role=\"group\" className={cn(label && !collapsed && s.groupMargin, className)} {...props}>\n {label && !collapsed && (\n <div className={cn(\n 'font-semibold text-text-subtle uppercase tracking-wider select-none',\n s.groupLabel,\n )}>\n {label}\n </div>\n )}\n <ul className=\"flex flex-col gap-0.5\">\n {children}\n </ul>\n </div>\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":";AAEA,YAAY,WAAW;AACvB,YAAY,6BAA6B;AACzC,YAAY,0BAA0B;AACtC,SAAS,YAAY;AACrB,SAAS,UAAU;AAInB,SAAS,gBAAgB,EAAE,UAAU,GAA2B;AAC9D,SACE,oCAAC,SAAI,WAAsB,MAAK,QAAO,SAAQ,aAAY,QAAO,gBAAe,aAAa,GAAG,eAAY,UAC3G,oCAAC,UAAK,eAAc,SAAQ,gBAAe,SAAQ,GAAE,kBAAiB,CACxE;AAEJ;AAEA,SAAS,iBAAiB,EAAE,UAAU,GAA2B;AAC/D,SACE,oCAAC,SAAI,WAAsB,MAAK,QAAO,SAAQ,aAAY,QAAO,gBAAe,aAAa,GAAG,eAAY,UAC3G,oCAAC,UAAK,eAAc,SAAQ,gBAAe,SAAQ,GAAE,gBAAe,CACtE;AAEJ;AAMA,MAAM,mBAAyD;AAAA,EAC7D,IAAI;AAAA;AAAA,EACJ,IAAI;AAAA;AAAA,EACJ,IAAI;AAAA;AAAA,EACJ,IAAI;AAAA;AACN;AAEA,MAAM,gBAAsD;AAAA,EAC1D,IAAI;AAAA;AAAA,EACJ,IAAI;AAAA;AAAA,EACJ,IAAI;AAAA;AAAA,EACJ,IAAI;AAAA;AACN;AAYA,MAAM,wBAAwB,MAAM,cAA0C;AAAA,EAC5E,aAAa;AAAA,EACb,MAAM;AAAA,EACN,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,YAAY;AACd,CAAC;AACD,MAAM,2BAA2B,MAAM,MAAM,WAAW,qBAAqB;AAG7E,MAAM,sBAAsB,MAAM,cAAc,KAAK;AAIrD,MAAM,wBAAwB;AAAA,EAC5B,IAAI;AAAA,IACF,SAAS;AAAA,IACT,MAAM;AAAA,IACN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AA,MAAxB;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,QACC,GAAG;AAAA;AAAA,IACN,CACF;AAAA,EAEJ;AACF;AACA,uBAAuB,cAAc;","names":[]}
@@ -0,0 +1,113 @@
1
+ import * as class_variance_authority_types from 'class-variance-authority/types';
2
+ import * as React from 'react';
3
+
4
+ type PaginationRange = (number | 'dots')[];
5
+ interface UsePaginationProps {
6
+ /** Total number of pages */
7
+ total: number;
8
+ /** Number of siblings on each side of current page */
9
+ siblings?: number;
10
+ /** Number of boundary pages at start/end */
11
+ boundaries?: number;
12
+ /** Current active page (1-based) */
13
+ page: number;
14
+ }
15
+ declare function usePagination({ total, siblings, boundaries, page, }: UsePaginationProps): PaginationRange;
16
+ type PaginationSize = 'xs' | 'sm' | 'default' | 'lg' | 'xl';
17
+ type PaginationVariant = 'default' | 'outline' | 'ghost';
18
+ type PaginationColor = 'default' | 'primary';
19
+ type PaginationRadius = 'sm' | 'base' | 'md' | 'lg' | 'xl' | 'full';
20
+ declare const paginationSizeMap: {
21
+ readonly xs: {
22
+ readonly item: "h-7 min-w-7 text-xs";
23
+ readonly icon: "icon-xs";
24
+ readonly gap: "gap-1";
25
+ };
26
+ readonly sm: {
27
+ readonly item: "h-8 min-w-8 text-sm";
28
+ readonly icon: "icon-xs";
29
+ readonly gap: "gap-1";
30
+ };
31
+ readonly default: {
32
+ readonly item: "h-9 min-w-9 text-md";
33
+ readonly icon: "icon-sm";
34
+ readonly gap: "gap-1";
35
+ };
36
+ readonly lg: {
37
+ readonly item: "h-10 min-w-10 text-md";
38
+ readonly icon: "icon-sm";
39
+ readonly gap: "gap-1.5";
40
+ };
41
+ readonly xl: {
42
+ readonly item: "h-12 min-w-12 text-base";
43
+ readonly icon: "icon-sm";
44
+ readonly gap: "gap-1.5";
45
+ };
46
+ };
47
+ declare const paginationItemVariants: (props?: ({
48
+ radius?: "sm" | "lg" | "base" | "md" | "xl" | "full" | null | undefined;
49
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
50
+ interface PaginationProps extends Omit<React.ComponentPropsWithoutRef<'nav'>, 'onChange'> {
51
+ /** Total number of pages */
52
+ total?: number;
53
+ /** Controlled active page (1-based) */
54
+ value?: number;
55
+ /** Initial page for uncontrolled mode */
56
+ defaultValue?: number;
57
+ /** Page change callback */
58
+ onChange?: (page: number) => void;
59
+ /** Number of siblings on each side of current page */
60
+ siblings?: number;
61
+ /** Number of boundary pages at start/end */
62
+ boundaries?: number;
63
+ /** Component size */
64
+ size?: PaginationSize;
65
+ /** Visual variant */
66
+ variant?: PaginationVariant;
67
+ /** Active page color */
68
+ color?: PaginationColor;
69
+ /** Border radius */
70
+ radius?: PaginationRadius;
71
+ /** Disable all interactions */
72
+ disabled?: boolean;
73
+ /** Show previous/next controls */
74
+ withControls?: boolean;
75
+ /** Show first/last controls */
76
+ withEdges?: boolean;
77
+ /** Loop from last to first and vice versa */
78
+ loop?: boolean;
79
+ }
80
+ declare const Pagination: React.ForwardRefExoticComponent<PaginationProps & React.RefAttributes<HTMLElement>>;
81
+ declare const PaginationContent: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & React.RefAttributes<HTMLUListElement>>;
82
+ declare const PaginationItem: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
83
+ interface PaginationLinkProps extends React.ComponentPropsWithoutRef<'button'> {
84
+ /** Page number this link navigates to */
85
+ page: number;
86
+ /** Whether this page is currently active (auto-detected from context if omitted) */
87
+ isActive?: boolean;
88
+ }
89
+ declare const PaginationLink: React.ForwardRefExoticComponent<PaginationLinkProps & React.RefAttributes<HTMLButtonElement>>;
90
+ interface PaginationPreviousProps extends React.ComponentPropsWithoutRef<'button'> {
91
+ /** Custom icon */
92
+ icon?: React.ReactNode;
93
+ }
94
+ declare const PaginationPrevious: React.ForwardRefExoticComponent<PaginationPreviousProps & React.RefAttributes<HTMLButtonElement>>;
95
+ interface PaginationNextProps extends React.ComponentPropsWithoutRef<'button'> {
96
+ /** Custom icon */
97
+ icon?: React.ReactNode;
98
+ }
99
+ declare const PaginationNext: React.ForwardRefExoticComponent<PaginationNextProps & React.RefAttributes<HTMLButtonElement>>;
100
+ interface PaginationFirstProps extends React.ComponentPropsWithoutRef<'button'> {
101
+ /** Custom icon */
102
+ icon?: React.ReactNode;
103
+ }
104
+ declare const PaginationFirst: React.ForwardRefExoticComponent<PaginationFirstProps & React.RefAttributes<HTMLButtonElement>>;
105
+ interface PaginationLastProps extends React.ComponentPropsWithoutRef<'button'> {
106
+ /** Custom icon */
107
+ icon?: React.ReactNode;
108
+ }
109
+ declare const PaginationLast: React.ForwardRefExoticComponent<PaginationLastProps & React.RefAttributes<HTMLButtonElement>>;
110
+ declare const PaginationEllipsis: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
111
+ declare const PaginationItems: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
112
+
113
+ export { Pagination, type PaginationColor, PaginationContent, PaginationEllipsis, PaginationFirst, type PaginationFirstProps, PaginationItem, PaginationItems, PaginationLast, type PaginationLastProps, PaginationLink, type PaginationLinkProps, PaginationNext, type PaginationNextProps, PaginationPrevious, type PaginationPreviousProps, type PaginationProps, type PaginationRadius, type PaginationRange, type PaginationSize, type PaginationVariant, type UsePaginationProps, paginationItemVariants, paginationSizeMap, usePagination };