@brightlocal/ui-components 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (236) hide show
  1. package/dist/accordion.cjs +1 -1
  2. package/dist/accordion.d.ts +74 -4
  3. package/dist/accordion.d.ts.map +1 -1
  4. package/dist/accordion.js +100 -105
  5. package/dist/alert-dialog.cjs +1 -1
  6. package/dist/alert-dialog.d.ts +30 -10
  7. package/dist/alert-dialog.d.ts.map +1 -1
  8. package/dist/alert-dialog.js +129 -132
  9. package/dist/alert.d.ts +22 -1
  10. package/dist/alert.d.ts.map +1 -1
  11. package/dist/aspect-ratio.cjs +1 -1
  12. package/dist/aspect-ratio.d.ts +11 -1
  13. package/dist/aspect-ratio.d.ts.map +1 -1
  14. package/dist/aspect-ratio.js +16 -20
  15. package/dist/avatar.cjs +1 -1
  16. package/dist/avatar.d.ts +43 -3
  17. package/dist/avatar.d.ts.map +1 -1
  18. package/dist/avatar.js +18 -16
  19. package/dist/badge.cjs +1 -1
  20. package/dist/badge.d.ts +24 -9
  21. package/dist/badge.d.ts.map +1 -1
  22. package/dist/badge.js +34 -32
  23. package/dist/blocks/data-table.cjs +1 -1
  24. package/dist/blocks/data-table.d.ts.map +1 -1
  25. package/dist/blocks/data-table.js +177 -170
  26. package/dist/blocks/sidebar.cjs +1 -1
  27. package/dist/blocks/sidebar.d.ts +1 -1
  28. package/dist/blocks/sidebar.d.ts.map +1 -1
  29. package/dist/blocks/sidebar.js +154 -154
  30. package/dist/breadcrumb.cjs +1 -1
  31. package/dist/breadcrumb.d.ts +63 -8
  32. package/dist/breadcrumb.d.ts.map +1 -1
  33. package/dist/breadcrumb.js +97 -93
  34. package/dist/button.cjs +1 -1
  35. package/dist/button.d.ts +17 -45
  36. package/dist/button.d.ts.map +1 -1
  37. package/dist/button.js +49 -50
  38. package/dist/calendar.cjs +1 -1
  39. package/dist/calendar.d.ts +12 -0
  40. package/dist/calendar.d.ts.map +1 -1
  41. package/dist/calendar.js +10 -8
  42. package/dist/card.cjs +1 -1
  43. package/dist/card.d.ts +58 -18
  44. package/dist/card.d.ts.map +1 -1
  45. package/dist/card.js +60 -51
  46. package/dist/carousel.cjs +1 -1
  47. package/dist/carousel.d.ts +99 -9
  48. package/dist/carousel.d.ts.map +1 -1
  49. package/dist/carousel.js +142 -128
  50. package/dist/centred-layout.cjs +1 -1
  51. package/dist/centred-layout.d.ts +18 -2
  52. package/dist/centred-layout.d.ts.map +1 -1
  53. package/dist/centred-layout.js +46 -33
  54. package/dist/chart.cjs +4 -4
  55. package/dist/chart.d.ts +70 -7
  56. package/dist/chart.d.ts.map +1 -1
  57. package/dist/chart.js +71 -66
  58. package/dist/checkbox.cjs +1 -1
  59. package/dist/checkbox.d.ts +9 -5
  60. package/dist/checkbox.d.ts.map +1 -1
  61. package/dist/checkbox.js +61 -82
  62. package/dist/collapsible.cjs +1 -1
  63. package/dist/collapsible.d.ts +65 -8
  64. package/dist/collapsible.d.ts.map +1 -1
  65. package/dist/collapsible.js +41 -55
  66. package/dist/combobox.cjs +1 -1
  67. package/dist/combobox.d.ts +29 -11
  68. package/dist/combobox.d.ts.map +1 -1
  69. package/dist/combobox.js +193 -159
  70. package/dist/command.cjs +1 -1
  71. package/dist/command.d.ts +115 -9
  72. package/dist/command.d.ts.map +1 -1
  73. package/dist/command.js +176 -152
  74. package/dist/context-menu.cjs +1 -1
  75. package/dist/context-menu.d.ts +188 -20
  76. package/dist/context-menu.d.ts.map +1 -1
  77. package/dist/context-menu.js +119 -121
  78. package/dist/date-picker.cjs +1 -1
  79. package/dist/date-picker.d.ts +75 -9
  80. package/dist/date-picker.d.ts.map +1 -1
  81. package/dist/date-picker.js +220 -81
  82. package/dist/description.cjs +1 -0
  83. package/dist/description.d.ts +37 -0
  84. package/dist/description.d.ts.map +1 -0
  85. package/dist/description.js +25 -0
  86. package/dist/dialog.cjs +1 -1
  87. package/dist/dialog.d.ts +73 -9
  88. package/dist/dialog.d.ts.map +1 -1
  89. package/dist/dialog.js +103 -112
  90. package/dist/drawer.cjs +1 -1
  91. package/dist/drawer.d.ts +92 -0
  92. package/dist/drawer.d.ts.map +1 -1
  93. package/dist/drawer.js +67 -52
  94. package/dist/dropdown-menu.cjs +1 -1
  95. package/dist/dropdown-menu.d.ts +95 -11
  96. package/dist/dropdown-menu.d.ts.map +1 -1
  97. package/dist/dropdown-menu.js +146 -106
  98. package/dist/field.cjs +1 -1
  99. package/dist/field.d.ts +23 -6
  100. package/dist/field.d.ts.map +1 -1
  101. package/dist/field.js +54 -53
  102. package/dist/global-layout.cjs +1 -1
  103. package/dist/global-layout.d.ts +27 -17
  104. package/dist/global-layout.d.ts.map +1 -1
  105. package/dist/global-layout.js +86 -79
  106. package/dist/hover-card.cjs +1 -1
  107. package/dist/hover-card.d.ts +36 -6
  108. package/dist/hover-card.d.ts.map +1 -1
  109. package/dist/hover-card.js +44 -42
  110. package/dist/index.cjs +1 -1
  111. package/dist/index.d.ts +1 -1
  112. package/dist/index.d.ts.map +1 -1
  113. package/dist/index.js +383 -387
  114. package/dist/input-group.cjs +1 -1
  115. package/dist/input-group.d.ts +21 -2
  116. package/dist/input-group.d.ts.map +1 -1
  117. package/dist/input-group.js +51 -41
  118. package/dist/input-password.cjs +1 -1
  119. package/dist/input-password.d.ts.map +1 -1
  120. package/dist/input-password.js +24 -25
  121. package/dist/input.cjs +1 -1
  122. package/dist/input.d.ts +38 -24
  123. package/dist/input.d.ts.map +1 -1
  124. package/dist/input.js +68 -136
  125. package/dist/label.cjs +1 -1
  126. package/dist/label.d.ts +20 -1
  127. package/dist/label.d.ts.map +1 -1
  128. package/dist/label.js +31 -18
  129. package/dist/logo.cjs +1 -1
  130. package/dist/logo.d.ts +3 -0
  131. package/dist/logo.d.ts.map +1 -1
  132. package/dist/logo.js +12 -10
  133. package/dist/menubar.cjs +1 -1
  134. package/dist/menubar.d.ts +40 -6
  135. package/dist/menubar.d.ts.map +1 -1
  136. package/dist/menubar.js +97 -76
  137. package/dist/popover.cjs +1 -1
  138. package/dist/popover.d.ts +59 -4
  139. package/dist/popover.d.ts.map +1 -1
  140. package/dist/popover.js +42 -34
  141. package/dist/progress.cjs +1 -1
  142. package/dist/progress.d.ts +9 -2
  143. package/dist/progress.d.ts.map +1 -1
  144. package/dist/progress.js +71 -59
  145. package/dist/radio-group.d.ts +40 -0
  146. package/dist/radio-group.d.ts.map +1 -1
  147. package/dist/rating.d.ts +4 -0
  148. package/dist/rating.d.ts.map +1 -1
  149. package/dist/resizable.cjs +1 -1
  150. package/dist/resizable.d.ts +65 -4
  151. package/dist/resizable.d.ts.map +1 -1
  152. package/dist/resizable.js +53 -36
  153. package/dist/scroll-area.cjs +1 -1
  154. package/dist/scroll-area.d.ts +46 -5
  155. package/dist/scroll-area.d.ts.map +1 -1
  156. package/dist/scroll-area.js +42 -38
  157. package/dist/select.cjs +1 -1
  158. package/dist/select.d.ts +30 -0
  159. package/dist/select.d.ts.map +1 -1
  160. package/dist/select.js +64 -54
  161. package/dist/separator.cjs +1 -1
  162. package/dist/separator.d.ts +49 -2
  163. package/dist/separator.d.ts.map +1 -1
  164. package/dist/separator.js +48 -36
  165. package/dist/sheet.cjs +1 -1
  166. package/dist/sheet.d.ts +80 -9
  167. package/dist/sheet.d.ts.map +1 -1
  168. package/dist/sheet.js +117 -113
  169. package/dist/skeleton.cjs +1 -1
  170. package/dist/skeleton.d.ts +24 -2
  171. package/dist/skeleton.d.ts.map +1 -1
  172. package/dist/skeleton.js +15 -9
  173. package/dist/slider.cjs +1 -1
  174. package/dist/slider.d.ts +18 -4
  175. package/dist/slider.d.ts.map +1 -1
  176. package/dist/slider.js +72 -66
  177. package/dist/sonner.cjs +1 -1
  178. package/dist/sonner.d.ts +4 -2
  179. package/dist/sonner.d.ts.map +1 -1
  180. package/dist/sonner.js +29 -28
  181. package/dist/split-layout.d.ts +4 -1
  182. package/dist/split-layout.d.ts.map +1 -1
  183. package/package.json +8 -2
  184. package/src/blocks/data-table.tsx +42 -32
  185. package/src/blocks/sidebar.tsx +4 -12
  186. package/src/components/accordion.tsx +163 -77
  187. package/src/components/alert-dialog.tsx +156 -111
  188. package/src/components/alert.tsx +26 -13
  189. package/src/components/aspect-ratio.tsx +25 -16
  190. package/src/components/avatar.tsx +56 -8
  191. package/src/components/badge.tsx +65 -42
  192. package/src/components/breadcrumb.tsx +158 -82
  193. package/src/components/button.tsx +41 -62
  194. package/src/components/calendar.tsx +16 -2
  195. package/src/components/card.tsx +92 -40
  196. package/src/components/carousel.tsx +240 -115
  197. package/src/components/centred-layout.tsx +67 -35
  198. package/src/components/chart.tsx +118 -47
  199. package/src/components/checkbox.tsx +42 -78
  200. package/src/components/collapsible.tsx +95 -26
  201. package/src/components/combobox.tsx +242 -144
  202. package/src/components/command.tsx +295 -121
  203. package/src/components/context-menu.tsx +278 -81
  204. package/src/components/date-picker.tsx +281 -30
  205. package/src/components/description.tsx +60 -0
  206. package/src/components/dialog.tsx +162 -86
  207. package/src/components/drawer.tsx +76 -2
  208. package/src/components/dropdown-menu.tsx +143 -37
  209. package/src/components/field.tsx +36 -11
  210. package/src/components/global-layout.tsx +116 -77
  211. package/src/components/hover-card.tsx +54 -14
  212. package/src/components/input-group.tsx +56 -18
  213. package/src/components/input-password.tsx +3 -4
  214. package/src/components/input.tsx +93 -186
  215. package/src/components/label.tsx +56 -15
  216. package/src/components/logo.tsx +3 -0
  217. package/src/components/menubar.tsx +58 -4
  218. package/src/components/popover.tsx +103 -20
  219. package/src/components/progress.tsx +82 -60
  220. package/src/components/radio-group.tsx +40 -0
  221. package/src/components/rating.tsx +4 -0
  222. package/src/components/resizable.tsx +119 -31
  223. package/src/components/scroll-area.tsx +123 -56
  224. package/src/components/select.tsx +21 -1
  225. package/src/components/separator.tsx +97 -20
  226. package/src/components/sheet.tsx +180 -79
  227. package/src/components/skeleton.tsx +40 -10
  228. package/src/components/slider.tsx +83 -57
  229. package/src/components/sonner.tsx +10 -7
  230. package/src/components/split-layout.tsx +4 -1
  231. package/src/index.ts +1 -1
  232. package/dist/input-base.cjs +0 -1
  233. package/dist/input-base.d.ts +0 -28
  234. package/dist/input-base.d.ts.map +0 -1
  235. package/dist/input-base.js +0 -56
  236. package/src/components/input-base.tsx +0 -86
@@ -5,45 +5,110 @@ import { Check, ChevronRight, Circle } from "lucide-react";
5
5
 
6
6
  import { cn } from "@brightlocal/ui-components/lib/utils";
7
7
 
8
- function ContextMenu({
9
- ...props
10
- }: React.ComponentProps<typeof ContextMenuPrimitive.Root>) {
8
+ /**
9
+ * Props for the ContextMenu component
10
+ */
11
+ export type ContextMenuProps = React.ComponentProps<
12
+ typeof ContextMenuPrimitive.Root
13
+ >;
14
+
15
+ /**
16
+ * A context menu component that displays a menu on right-click.
17
+ * Built with Radix UI Context Menu primitive.
18
+ */
19
+ function ContextMenu({ ...props }: ContextMenuProps) {
11
20
  return <ContextMenuPrimitive.Root data-slot="context-menu" {...props} />;
12
21
  }
22
+ ContextMenu.displayName = "ContextMenu";
13
23
 
14
- function ContextMenuTrigger({
15
- ...props
16
- }: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>) {
17
- return (
18
- <ContextMenuPrimitive.Trigger data-slot="context-menu-trigger" {...props} />
19
- );
24
+ /**
25
+ * Props for the ContextMenuTrigger component
26
+ */
27
+ export interface ContextMenuTriggerProps extends React.ComponentProps<
28
+ typeof ContextMenuPrimitive.Trigger
29
+ > {
30
+ /**
31
+ * Data hook for automated testing
32
+ */
33
+ dataHook?: string;
20
34
  }
21
35
 
22
- function ContextMenuGroup({
23
- ...props
24
- }: React.ComponentProps<typeof ContextMenuPrimitive.Group>) {
36
+ /**
37
+ * The element that triggers the context menu on right-click.
38
+ */
39
+ const ContextMenuTrigger = React.forwardRef<
40
+ React.ComponentRef<typeof ContextMenuPrimitive.Trigger>,
41
+ ContextMenuTriggerProps
42
+ >(({ dataHook, ...props }, ref) => (
43
+ <ContextMenuPrimitive.Trigger
44
+ ref={ref}
45
+ data-hook={dataHook}
46
+ data-slot="context-menu-trigger"
47
+ {...props}
48
+ />
49
+ ));
50
+ ContextMenuTrigger.displayName = "ContextMenuTrigger";
51
+
52
+ /**
53
+ * Props for the ContextMenuGroup component
54
+ */
55
+ export type ContextMenuGroupProps = React.ComponentProps<
56
+ typeof ContextMenuPrimitive.Group
57
+ >;
58
+
59
+ /**
60
+ * Groups related context menu items together.
61
+ */
62
+ function ContextMenuGroup({ ...props }: ContextMenuGroupProps) {
25
63
  return (
26
64
  <ContextMenuPrimitive.Group data-slot="context-menu-group" {...props} />
27
65
  );
28
66
  }
67
+ ContextMenuGroup.displayName = "ContextMenuGroup";
29
68
 
30
- function ContextMenuPortal({
31
- ...props
32
- }: React.ComponentProps<typeof ContextMenuPrimitive.Portal>) {
69
+ /**
70
+ * Props for the ContextMenuPortal component
71
+ */
72
+ export type ContextMenuPortalProps = React.ComponentProps<
73
+ typeof ContextMenuPrimitive.Portal
74
+ >;
75
+
76
+ /**
77
+ * Portal for rendering context menu content outside the DOM hierarchy.
78
+ */
79
+ function ContextMenuPortal({ ...props }: ContextMenuPortalProps) {
33
80
  return (
34
81
  <ContextMenuPrimitive.Portal data-slot="context-menu-portal" {...props} />
35
82
  );
36
83
  }
84
+ ContextMenuPortal.displayName = "ContextMenuPortal";
85
+
86
+ /**
87
+ * Props for the ContextMenuSub component
88
+ */
89
+ export type ContextMenuSubProps = React.ComponentProps<
90
+ typeof ContextMenuPrimitive.Sub
91
+ >;
37
92
 
38
- function ContextMenuSub({
39
- ...props
40
- }: React.ComponentProps<typeof ContextMenuPrimitive.Sub>) {
93
+ /**
94
+ * A sub-menu container for nested context menu items.
95
+ */
96
+ function ContextMenuSub({ ...props }: ContextMenuSubProps) {
41
97
  return <ContextMenuPrimitive.Sub data-slot="context-menu-sub" {...props} />;
42
98
  }
99
+ ContextMenuSub.displayName = "ContextMenuSub";
43
100
 
44
- function ContextMenuRadioGroup({
45
- ...props
46
- }: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>) {
101
+ /**
102
+ * Props for the ContextMenuRadioGroup component
103
+ */
104
+ export type ContextMenuRadioGroupProps = React.ComponentProps<
105
+ typeof ContextMenuPrimitive.RadioGroup
106
+ >;
107
+
108
+ /**
109
+ * A group of radio items where only one can be selected at a time.
110
+ */
111
+ function ContextMenuRadioGroup({ ...props }: ContextMenuRadioGroupProps) {
47
112
  return (
48
113
  <ContextMenuPrimitive.RadioGroup
49
114
  data-slot="context-menu-radio-group"
@@ -51,15 +116,38 @@ function ContextMenuRadioGroup({
51
116
  />
52
117
  );
53
118
  }
119
+ ContextMenuRadioGroup.displayName = "ContextMenuRadioGroup";
120
+
121
+ /**
122
+ * Props for the ContextMenuSubTrigger component
123
+ */
124
+ export interface ContextMenuSubTriggerProps extends React.ComponentPropsWithoutRef<
125
+ typeof ContextMenuPrimitive.SubTrigger
126
+ > {
127
+ /**
128
+ * Whether to add left padding for alignment with other items
129
+ */
130
+ inset?: boolean;
131
+ /**
132
+ * Data hook for automated testing
133
+ */
134
+ dataHook?: string;
135
+ /**
136
+ * Tracking element identifier for analytics
137
+ */
138
+ trackingEl?: string;
139
+ /**
140
+ * Tracking label for analytics context
141
+ */
142
+ trackingLabel?: string;
143
+ }
54
144
 
145
+ /**
146
+ * Trigger for opening a sub-menu within the context menu.
147
+ */
55
148
  const ContextMenuSubTrigger = React.forwardRef<
56
- React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>,
57
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> & {
58
- inset?: boolean;
59
- dataHook?: string;
60
- trackingEl?: string;
61
- trackingLabel?: string;
62
- }
149
+ React.ComponentRef<typeof ContextMenuPrimitive.SubTrigger>,
150
+ ContextMenuSubTriggerProps
63
151
  >(
64
152
  (
65
153
  {
@@ -91,11 +179,21 @@ const ContextMenuSubTrigger = React.forwardRef<
91
179
  </ContextMenuPrimitive.SubTrigger>
92
180
  )
93
181
  );
94
- ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
182
+ ContextMenuSubTrigger.displayName = "ContextMenuSubTrigger";
95
183
 
184
+ /**
185
+ * Props for the ContextMenuSubContent component
186
+ */
187
+ export type ContextMenuSubContentProps = React.ComponentPropsWithoutRef<
188
+ typeof ContextMenuPrimitive.SubContent
189
+ >;
190
+
191
+ /**
192
+ * Content container for a sub-menu.
193
+ */
96
194
  const ContextMenuSubContent = React.forwardRef<
97
- React.ElementRef<typeof ContextMenuPrimitive.SubContent>,
98
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>
195
+ React.ComponentRef<typeof ContextMenuPrimitive.SubContent>,
196
+ ContextMenuSubContentProps
99
197
  >(({ className, ...props }, ref) => (
100
198
  <ContextMenuPrimitive.SubContent
101
199
  ref={ref}
@@ -107,11 +205,21 @@ const ContextMenuSubContent = React.forwardRef<
107
205
  {...props}
108
206
  />
109
207
  ));
110
- ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
208
+ ContextMenuSubContent.displayName = "ContextMenuSubContent";
209
+
210
+ /**
211
+ * Props for the ContextMenuContent component
212
+ */
213
+ export type ContextMenuContentProps = React.ComponentPropsWithoutRef<
214
+ typeof ContextMenuPrimitive.Content
215
+ >;
111
216
 
217
+ /**
218
+ * Main content container for the context menu.
219
+ */
112
220
  const ContextMenuContent = React.forwardRef<
113
- React.ElementRef<typeof ContextMenuPrimitive.Content>,
114
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>
221
+ React.ComponentRef<typeof ContextMenuPrimitive.Content>,
222
+ ContextMenuContentProps
115
223
  >(({ className, ...props }, ref) => (
116
224
  <ContextMenuPrimitive.Portal>
117
225
  <ContextMenuPrimitive.Content
@@ -125,16 +233,38 @@ const ContextMenuContent = React.forwardRef<
125
233
  />
126
234
  </ContextMenuPrimitive.Portal>
127
235
  ));
128
- ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
236
+ ContextMenuContent.displayName = "ContextMenuContent";
129
237
 
238
+ /**
239
+ * Props for the ContextMenuItem component
240
+ */
241
+ export interface ContextMenuItemProps extends React.ComponentPropsWithoutRef<
242
+ typeof ContextMenuPrimitive.Item
243
+ > {
244
+ /**
245
+ * Whether to add left padding for alignment with other items
246
+ */
247
+ inset?: boolean;
248
+ /**
249
+ * Data hook for automated testing
250
+ */
251
+ dataHook?: string;
252
+ /**
253
+ * Tracking element identifier for analytics
254
+ */
255
+ trackingEl?: string;
256
+ /**
257
+ * Tracking label for analytics context
258
+ */
259
+ trackingLabel?: string;
260
+ }
261
+
262
+ /**
263
+ * An interactive item in the context menu.
264
+ */
130
265
  const ContextMenuItem = React.forwardRef<
131
- React.ElementRef<typeof ContextMenuPrimitive.Item>,
132
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & {
133
- inset?: boolean;
134
- dataHook?: string;
135
- trackingEl?: string;
136
- trackingLabel?: string;
137
- }
266
+ React.ComponentRef<typeof ContextMenuPrimitive.Item>,
267
+ ContextMenuItemProps
138
268
  >(
139
269
  (
140
270
  { className, inset, dataHook, trackingEl, trackingLabel, ...props },
@@ -155,15 +285,34 @@ const ContextMenuItem = React.forwardRef<
155
285
  />
156
286
  )
157
287
  );
158
- ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
288
+ ContextMenuItem.displayName = "ContextMenuItem";
159
289
 
290
+ /**
291
+ * Props for the ContextMenuCheckboxItem component
292
+ */
293
+ export interface ContextMenuCheckboxItemProps extends React.ComponentPropsWithoutRef<
294
+ typeof ContextMenuPrimitive.CheckboxItem
295
+ > {
296
+ /**
297
+ * Data hook for automated testing
298
+ */
299
+ dataHook?: string;
300
+ /**
301
+ * Tracking element identifier for analytics
302
+ */
303
+ trackingEl?: string;
304
+ /**
305
+ * Tracking label for analytics context
306
+ */
307
+ trackingLabel?: string;
308
+ }
309
+
310
+ /**
311
+ * A checkbox item that can be toggled on/off in the context menu.
312
+ */
160
313
  const ContextMenuCheckboxItem = React.forwardRef<
161
- React.ElementRef<typeof ContextMenuPrimitive.CheckboxItem>,
162
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem> & {
163
- dataHook?: string;
164
- trackingEl?: string;
165
- trackingLabel?: string;
166
- }
314
+ React.ComponentRef<typeof ContextMenuPrimitive.CheckboxItem>,
315
+ ContextMenuCheckboxItemProps
167
316
  >(
168
317
  (
169
318
  {
@@ -199,16 +348,34 @@ const ContextMenuCheckboxItem = React.forwardRef<
199
348
  </ContextMenuPrimitive.CheckboxItem>
200
349
  )
201
350
  );
202
- ContextMenuCheckboxItem.displayName =
203
- ContextMenuPrimitive.CheckboxItem.displayName;
351
+ ContextMenuCheckboxItem.displayName = "ContextMenuCheckboxItem";
352
+
353
+ /**
354
+ * Props for the ContextMenuRadioItem component
355
+ */
356
+ export interface ContextMenuRadioItemProps extends React.ComponentPropsWithoutRef<
357
+ typeof ContextMenuPrimitive.RadioItem
358
+ > {
359
+ /**
360
+ * Data hook for automated testing
361
+ */
362
+ dataHook?: string;
363
+ /**
364
+ * Tracking element identifier for analytics
365
+ */
366
+ trackingEl?: string;
367
+ /**
368
+ * Tracking label for analytics context
369
+ */
370
+ trackingLabel?: string;
371
+ }
204
372
 
373
+ /**
374
+ * A radio item within a radio group, where only one can be selected.
375
+ */
205
376
  const ContextMenuRadioItem = React.forwardRef<
206
- React.ElementRef<typeof ContextMenuPrimitive.RadioItem>,
207
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem> & {
208
- dataHook?: string;
209
- trackingEl?: string;
210
- trackingLabel?: string;
211
- }
377
+ React.ComponentRef<typeof ContextMenuPrimitive.RadioItem>,
378
+ ContextMenuRadioItemProps
212
379
  >(
213
380
  (
214
381
  { className, children, dataHook, trackingEl, trackingLabel, ...props },
@@ -235,13 +402,26 @@ const ContextMenuRadioItem = React.forwardRef<
235
402
  </ContextMenuPrimitive.RadioItem>
236
403
  )
237
404
  );
238
- ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
405
+ ContextMenuRadioItem.displayName = "ContextMenuRadioItem";
406
+
407
+ /**
408
+ * Props for the ContextMenuLabel component
409
+ */
410
+ export interface ContextMenuLabelProps extends React.ComponentPropsWithoutRef<
411
+ typeof ContextMenuPrimitive.Label
412
+ > {
413
+ /**
414
+ * Whether to add left padding for alignment with other items
415
+ */
416
+ inset?: boolean;
417
+ }
239
418
 
419
+ /**
420
+ * A non-interactive label for grouping menu items.
421
+ */
240
422
  const ContextMenuLabel = React.forwardRef<
241
- React.ElementRef<typeof ContextMenuPrimitive.Label>,
242
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> & {
243
- inset?: boolean;
244
- }
423
+ React.ComponentRef<typeof ContextMenuPrimitive.Label>,
424
+ ContextMenuLabelProps
245
425
  >(({ className, inset, ...props }, ref) => (
246
426
  <ContextMenuPrimitive.Label
247
427
  ref={ref}
@@ -254,11 +434,21 @@ const ContextMenuLabel = React.forwardRef<
254
434
  {...props}
255
435
  />
256
436
  ));
257
- ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
437
+ ContextMenuLabel.displayName = "ContextMenuLabel";
258
438
 
439
+ /**
440
+ * Props for the ContextMenuSeparator component
441
+ */
442
+ export type ContextMenuSeparatorProps = React.ComponentPropsWithoutRef<
443
+ typeof ContextMenuPrimitive.Separator
444
+ >;
445
+
446
+ /**
447
+ * Visual separator between groups of menu items.
448
+ */
259
449
  const ContextMenuSeparator = React.forwardRef<
260
- React.ElementRef<typeof ContextMenuPrimitive.Separator>,
261
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>
450
+ React.ComponentRef<typeof ContextMenuPrimitive.Separator>,
451
+ ContextMenuSeparatorProps
262
452
  >(({ className, ...props }, ref) => (
263
453
  <ContextMenuPrimitive.Separator
264
454
  ref={ref}
@@ -267,23 +457,30 @@ const ContextMenuSeparator = React.forwardRef<
267
457
  {...props}
268
458
  />
269
459
  ));
270
- ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;
460
+ ContextMenuSeparator.displayName = "ContextMenuSeparator";
271
461
 
272
- const ContextMenuShortcut = ({
273
- className,
274
- ...props
275
- }: React.HTMLAttributes<HTMLSpanElement>) => {
276
- return (
277
- <span
278
- className={cn(
279
- "text-muted-foreground ml-auto text-xs tracking-widest",
280
- className
281
- )}
282
- data-slot="context-menu-shortcut"
283
- {...props}
284
- />
285
- );
286
- };
462
+ /**
463
+ * Props for the ContextMenuShortcut component
464
+ */
465
+ export type ContextMenuShortcutProps = React.HTMLAttributes<HTMLSpanElement>;
466
+
467
+ /**
468
+ * Displays a keyboard shortcut hint for a menu item.
469
+ */
470
+ const ContextMenuShortcut = React.forwardRef<
471
+ HTMLSpanElement,
472
+ ContextMenuShortcutProps
473
+ >(({ className, ...props }, ref) => (
474
+ <span
475
+ ref={ref}
476
+ className={cn(
477
+ "text-muted-foreground ml-auto text-xs tracking-widest",
478
+ className
479
+ )}
480
+ data-slot="context-menu-shortcut"
481
+ {...props}
482
+ />
483
+ ));
287
484
  ContextMenuShortcut.displayName = "ContextMenuShortcut";
288
485
 
289
486
  export {