@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.
- package/dist/accordion.cjs +1 -1
- package/dist/accordion.d.ts +74 -4
- package/dist/accordion.d.ts.map +1 -1
- package/dist/accordion.js +100 -105
- package/dist/alert-dialog.cjs +1 -1
- package/dist/alert-dialog.d.ts +30 -10
- package/dist/alert-dialog.d.ts.map +1 -1
- package/dist/alert-dialog.js +129 -132
- package/dist/alert.d.ts +22 -1
- package/dist/alert.d.ts.map +1 -1
- package/dist/aspect-ratio.cjs +1 -1
- package/dist/aspect-ratio.d.ts +11 -1
- package/dist/aspect-ratio.d.ts.map +1 -1
- package/dist/aspect-ratio.js +16 -20
- package/dist/avatar.cjs +1 -1
- package/dist/avatar.d.ts +43 -3
- package/dist/avatar.d.ts.map +1 -1
- package/dist/avatar.js +18 -16
- package/dist/badge.cjs +1 -1
- package/dist/badge.d.ts +24 -9
- package/dist/badge.d.ts.map +1 -1
- package/dist/badge.js +34 -32
- package/dist/blocks/data-table.cjs +1 -1
- package/dist/blocks/data-table.d.ts.map +1 -1
- package/dist/blocks/data-table.js +177 -170
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +1 -1
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +154 -154
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.d.ts +63 -8
- package/dist/breadcrumb.d.ts.map +1 -1
- package/dist/breadcrumb.js +97 -93
- package/dist/button.cjs +1 -1
- package/dist/button.d.ts +17 -45
- package/dist/button.d.ts.map +1 -1
- package/dist/button.js +49 -50
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.d.ts +12 -0
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +10 -8
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +58 -18
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +60 -51
- package/dist/carousel.cjs +1 -1
- package/dist/carousel.d.ts +99 -9
- package/dist/carousel.d.ts.map +1 -1
- package/dist/carousel.js +142 -128
- package/dist/centred-layout.cjs +1 -1
- package/dist/centred-layout.d.ts +18 -2
- package/dist/centred-layout.d.ts.map +1 -1
- package/dist/centred-layout.js +46 -33
- package/dist/chart.cjs +4 -4
- package/dist/chart.d.ts +70 -7
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +71 -66
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.d.ts +9 -5
- package/dist/checkbox.d.ts.map +1 -1
- package/dist/checkbox.js +61 -82
- package/dist/collapsible.cjs +1 -1
- package/dist/collapsible.d.ts +65 -8
- package/dist/collapsible.d.ts.map +1 -1
- package/dist/collapsible.js +41 -55
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.d.ts +29 -11
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +193 -159
- package/dist/command.cjs +1 -1
- package/dist/command.d.ts +115 -9
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +176 -152
- package/dist/context-menu.cjs +1 -1
- package/dist/context-menu.d.ts +188 -20
- package/dist/context-menu.d.ts.map +1 -1
- package/dist/context-menu.js +119 -121
- package/dist/date-picker.cjs +1 -1
- package/dist/date-picker.d.ts +75 -9
- package/dist/date-picker.d.ts.map +1 -1
- package/dist/date-picker.js +220 -81
- package/dist/description.cjs +1 -0
- package/dist/description.d.ts +37 -0
- package/dist/description.d.ts.map +1 -0
- package/dist/description.js +25 -0
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.d.ts +73 -9
- package/dist/dialog.d.ts.map +1 -1
- package/dist/dialog.js +103 -112
- package/dist/drawer.cjs +1 -1
- package/dist/drawer.d.ts +92 -0
- package/dist/drawer.d.ts.map +1 -1
- package/dist/drawer.js +67 -52
- package/dist/dropdown-menu.cjs +1 -1
- package/dist/dropdown-menu.d.ts +95 -11
- package/dist/dropdown-menu.d.ts.map +1 -1
- package/dist/dropdown-menu.js +146 -106
- package/dist/field.cjs +1 -1
- package/dist/field.d.ts +23 -6
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +54 -53
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.d.ts +27 -17
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +86 -79
- package/dist/hover-card.cjs +1 -1
- package/dist/hover-card.d.ts +36 -6
- package/dist/hover-card.d.ts.map +1 -1
- package/dist/hover-card.js +44 -42
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +383 -387
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.d.ts +21 -2
- package/dist/input-group.d.ts.map +1 -1
- package/dist/input-group.js +51 -41
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.d.ts.map +1 -1
- package/dist/input-password.js +24 -25
- package/dist/input.cjs +1 -1
- package/dist/input.d.ts +38 -24
- package/dist/input.d.ts.map +1 -1
- package/dist/input.js +68 -136
- package/dist/label.cjs +1 -1
- package/dist/label.d.ts +20 -1
- package/dist/label.d.ts.map +1 -1
- package/dist/label.js +31 -18
- package/dist/logo.cjs +1 -1
- package/dist/logo.d.ts +3 -0
- package/dist/logo.d.ts.map +1 -1
- package/dist/logo.js +12 -10
- package/dist/menubar.cjs +1 -1
- package/dist/menubar.d.ts +40 -6
- package/dist/menubar.d.ts.map +1 -1
- package/dist/menubar.js +97 -76
- package/dist/popover.cjs +1 -1
- package/dist/popover.d.ts +59 -4
- package/dist/popover.d.ts.map +1 -1
- package/dist/popover.js +42 -34
- package/dist/progress.cjs +1 -1
- package/dist/progress.d.ts +9 -2
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +71 -59
- package/dist/radio-group.d.ts +40 -0
- package/dist/radio-group.d.ts.map +1 -1
- package/dist/rating.d.ts +4 -0
- package/dist/rating.d.ts.map +1 -1
- package/dist/resizable.cjs +1 -1
- package/dist/resizable.d.ts +65 -4
- package/dist/resizable.d.ts.map +1 -1
- package/dist/resizable.js +53 -36
- package/dist/scroll-area.cjs +1 -1
- package/dist/scroll-area.d.ts +46 -5
- package/dist/scroll-area.d.ts.map +1 -1
- package/dist/scroll-area.js +42 -38
- package/dist/select.cjs +1 -1
- package/dist/select.d.ts +30 -0
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +64 -54
- package/dist/separator.cjs +1 -1
- package/dist/separator.d.ts +49 -2
- package/dist/separator.d.ts.map +1 -1
- package/dist/separator.js +48 -36
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +80 -9
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +117 -113
- package/dist/skeleton.cjs +1 -1
- package/dist/skeleton.d.ts +24 -2
- package/dist/skeleton.d.ts.map +1 -1
- package/dist/skeleton.js +15 -9
- package/dist/slider.cjs +1 -1
- package/dist/slider.d.ts +18 -4
- package/dist/slider.d.ts.map +1 -1
- package/dist/slider.js +72 -66
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.d.ts +4 -2
- package/dist/sonner.d.ts.map +1 -1
- package/dist/sonner.js +29 -28
- package/dist/split-layout.d.ts +4 -1
- package/dist/split-layout.d.ts.map +1 -1
- package/package.json +8 -2
- package/src/blocks/data-table.tsx +42 -32
- package/src/blocks/sidebar.tsx +4 -12
- package/src/components/accordion.tsx +163 -77
- package/src/components/alert-dialog.tsx +156 -111
- package/src/components/alert.tsx +26 -13
- package/src/components/aspect-ratio.tsx +25 -16
- package/src/components/avatar.tsx +56 -8
- package/src/components/badge.tsx +65 -42
- package/src/components/breadcrumb.tsx +158 -82
- package/src/components/button.tsx +41 -62
- package/src/components/calendar.tsx +16 -2
- package/src/components/card.tsx +92 -40
- package/src/components/carousel.tsx +240 -115
- package/src/components/centred-layout.tsx +67 -35
- package/src/components/chart.tsx +118 -47
- package/src/components/checkbox.tsx +42 -78
- package/src/components/collapsible.tsx +95 -26
- package/src/components/combobox.tsx +242 -144
- package/src/components/command.tsx +295 -121
- package/src/components/context-menu.tsx +278 -81
- package/src/components/date-picker.tsx +281 -30
- package/src/components/description.tsx +60 -0
- package/src/components/dialog.tsx +162 -86
- package/src/components/drawer.tsx +76 -2
- package/src/components/dropdown-menu.tsx +143 -37
- package/src/components/field.tsx +36 -11
- package/src/components/global-layout.tsx +116 -77
- package/src/components/hover-card.tsx +54 -14
- package/src/components/input-group.tsx +56 -18
- package/src/components/input-password.tsx +3 -4
- package/src/components/input.tsx +93 -186
- package/src/components/label.tsx +56 -15
- package/src/components/logo.tsx +3 -0
- package/src/components/menubar.tsx +58 -4
- package/src/components/popover.tsx +103 -20
- package/src/components/progress.tsx +82 -60
- package/src/components/radio-group.tsx +40 -0
- package/src/components/rating.tsx +4 -0
- package/src/components/resizable.tsx +119 -31
- package/src/components/scroll-area.tsx +123 -56
- package/src/components/select.tsx +21 -1
- package/src/components/separator.tsx +97 -20
- package/src/components/sheet.tsx +180 -79
- package/src/components/skeleton.tsx +40 -10
- package/src/components/slider.tsx +83 -57
- package/src/components/sonner.tsx +10 -7
- package/src/components/split-layout.tsx +4 -1
- package/src/index.ts +1 -1
- package/dist/input-base.cjs +0 -1
- package/dist/input-base.d.ts +0 -28
- package/dist/input-base.d.ts.map +0 -1
- package/dist/input-base.js +0 -56
- 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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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.
|
|
57
|
-
|
|
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 =
|
|
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.
|
|
98
|
-
|
|
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 =
|
|
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.
|
|
114
|
-
|
|
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 =
|
|
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.
|
|
132
|
-
|
|
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 =
|
|
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.
|
|
162
|
-
|
|
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
|
-
|
|
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.
|
|
207
|
-
|
|
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 =
|
|
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.
|
|
242
|
-
|
|
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 =
|
|
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.
|
|
261
|
-
|
|
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 =
|
|
460
|
+
ContextMenuSeparator.displayName = "ContextMenuSeparator";
|
|
271
461
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
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 {
|