@kopexa/dropdown-menu 0.0.0-canary-20250721083908
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/README.md +24 -0
- package/dist/chunk-NF4CISAE.mjs +224 -0
- package/dist/chunk-OEIWSUDF.mjs +43 -0
- package/dist/dropdown-menu.d.mts +43 -0
- package/dist/dropdown-menu.d.ts +43 -0
- package/dist/dropdown-menu.js +265 -0
- package/dist/dropdown-menu.mjs +35 -0
- package/dist/index.d.mts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +259 -0
- package/dist/index.mjs +8 -0
- package/dist/namespace.d.mts +10 -0
- package/dist/namespace.d.ts +10 -0
- package/dist/namespace.js +267 -0
- package/dist/namespace.mjs +36 -0
- package/package.json +57 -0
package/README.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# @kopexa/dropdown-menu
|
|
2
|
+
|
|
3
|
+
A Quick description of the component
|
|
4
|
+
|
|
5
|
+
> This is an internal utility, not intended for public usage.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
yarn add @kopexa/dropdown-menu
|
|
11
|
+
# or
|
|
12
|
+
npm i @kopexa/dropdown-menu
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Contribution
|
|
16
|
+
|
|
17
|
+
Yes please! See the
|
|
18
|
+
[contributing guidelines](https://github.com/kopexa-grc/sight/blob/master/CONTRIBUTING.md)
|
|
19
|
+
for details.
|
|
20
|
+
|
|
21
|
+
## License
|
|
22
|
+
|
|
23
|
+
This project is licensed under the terms of the
|
|
24
|
+
[MIT license](https://github.com/kopexa-grc/sight/blob/master/LICENSE).
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __export = (target, all) => {
|
|
4
|
+
for (var name in all)
|
|
5
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
// src/dropdown-menu.tsx
|
|
9
|
+
import { CheckIcon, ChevronRightIcon, CircleIcon } from "@kopexa/icons";
|
|
10
|
+
import { createContext } from "@kopexa/react-utils";
|
|
11
|
+
import { dataAttr } from "@kopexa/shared-utils";
|
|
12
|
+
import { dropdownMenu } from "@kopexa/theme";
|
|
13
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
14
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
var [Provider, useDropdownMenuContext] = createContext();
|
|
16
|
+
function DropdownMenuRoot(props) {
|
|
17
|
+
const styles = dropdownMenu();
|
|
18
|
+
return /* @__PURE__ */ jsx(Provider, { value: { styles }, children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props }) });
|
|
19
|
+
}
|
|
20
|
+
function DropdownMenuPortal({
|
|
21
|
+
...props
|
|
22
|
+
}) {
|
|
23
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { "data-slot": "dropdown-menu-portal", ...props });
|
|
24
|
+
}
|
|
25
|
+
function DropdownMenuTrigger({ ...props }) {
|
|
26
|
+
return /* @__PURE__ */ jsx(
|
|
27
|
+
DropdownMenuPrimitive.Trigger,
|
|
28
|
+
{
|
|
29
|
+
"data-slot": "dropdown-menu-trigger",
|
|
30
|
+
...props
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
function DropdownMenuContent({
|
|
35
|
+
className,
|
|
36
|
+
sideOffset = 4,
|
|
37
|
+
...props
|
|
38
|
+
}) {
|
|
39
|
+
const styles = dropdownMenu();
|
|
40
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
41
|
+
DropdownMenuPrimitive.Content,
|
|
42
|
+
{
|
|
43
|
+
"data-slot": "dropdown-menu-content",
|
|
44
|
+
sideOffset,
|
|
45
|
+
className: styles.content({ className }),
|
|
46
|
+
...props
|
|
47
|
+
}
|
|
48
|
+
) });
|
|
49
|
+
}
|
|
50
|
+
function DropdownMenuGroup({ ...props }) {
|
|
51
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props });
|
|
52
|
+
}
|
|
53
|
+
function DropdownMenuItem({
|
|
54
|
+
className,
|
|
55
|
+
inset,
|
|
56
|
+
variant = "default",
|
|
57
|
+
...props
|
|
58
|
+
}) {
|
|
59
|
+
const { styles } = useDropdownMenuContext();
|
|
60
|
+
return /* @__PURE__ */ jsx(
|
|
61
|
+
DropdownMenuPrimitive.Item,
|
|
62
|
+
{
|
|
63
|
+
"data-slot": "dropdown-menu-item",
|
|
64
|
+
"data-inset": inset,
|
|
65
|
+
"data-variant": variant,
|
|
66
|
+
className: styles.item({
|
|
67
|
+
className
|
|
68
|
+
}),
|
|
69
|
+
...props
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
function DropdownMenuCheckboxItem({
|
|
74
|
+
className,
|
|
75
|
+
children,
|
|
76
|
+
checked,
|
|
77
|
+
...props
|
|
78
|
+
}) {
|
|
79
|
+
const { styles } = useDropdownMenuContext();
|
|
80
|
+
return /* @__PURE__ */ jsxs(
|
|
81
|
+
DropdownMenuPrimitive.CheckboxItem,
|
|
82
|
+
{
|
|
83
|
+
"data-slot": "dropdown-menu-checkbox-item",
|
|
84
|
+
className: styles.checkboxItem({ className }),
|
|
85
|
+
checked,
|
|
86
|
+
...props,
|
|
87
|
+
children: [
|
|
88
|
+
/* @__PURE__ */ jsx("span", { className: styles.iconWrapper(), children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: styles.icon() }) }) }),
|
|
89
|
+
children
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
function DropdownMenuRadioGroup({
|
|
95
|
+
...props
|
|
96
|
+
}) {
|
|
97
|
+
return /* @__PURE__ */ jsx(
|
|
98
|
+
DropdownMenuPrimitive.RadioGroup,
|
|
99
|
+
{
|
|
100
|
+
"data-slot": "dropdown-menu-radio-group",
|
|
101
|
+
...props
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
function DropdownMenuRadioItem({
|
|
106
|
+
className,
|
|
107
|
+
children,
|
|
108
|
+
...props
|
|
109
|
+
}) {
|
|
110
|
+
const { styles } = useDropdownMenuContext();
|
|
111
|
+
return /* @__PURE__ */ jsxs(
|
|
112
|
+
DropdownMenuPrimitive.RadioItem,
|
|
113
|
+
{
|
|
114
|
+
"data-slot": "dropdown-menu-radio-item",
|
|
115
|
+
className: styles.radioItem({ className }),
|
|
116
|
+
...props,
|
|
117
|
+
children: [
|
|
118
|
+
/* @__PURE__ */ jsx("span", { className: styles.iconWrapper(), children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CircleIcon, { className: styles.radioItemIcon() }) }) }),
|
|
119
|
+
children
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
function DropdownMenuLabel({
|
|
125
|
+
className,
|
|
126
|
+
inset,
|
|
127
|
+
...props
|
|
128
|
+
}) {
|
|
129
|
+
const { styles } = useDropdownMenuContext();
|
|
130
|
+
return /* @__PURE__ */ jsx(
|
|
131
|
+
DropdownMenuPrimitive.Label,
|
|
132
|
+
{
|
|
133
|
+
"data-slot": "dropdown-menu-label",
|
|
134
|
+
"data-inset": inset,
|
|
135
|
+
className: styles.label({ className }),
|
|
136
|
+
...props
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
function DropdownMenuSeparator({
|
|
141
|
+
className,
|
|
142
|
+
...props
|
|
143
|
+
}) {
|
|
144
|
+
const { styles } = useDropdownMenuContext();
|
|
145
|
+
return /* @__PURE__ */ jsx(
|
|
146
|
+
DropdownMenuPrimitive.Separator,
|
|
147
|
+
{
|
|
148
|
+
"data-slot": "dropdown-menu-separator",
|
|
149
|
+
className: styles.separator({ className }),
|
|
150
|
+
...props
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
function DropdownMenuShortcut({
|
|
155
|
+
className,
|
|
156
|
+
...props
|
|
157
|
+
}) {
|
|
158
|
+
const { styles } = useDropdownMenuContext();
|
|
159
|
+
return /* @__PURE__ */ jsx(
|
|
160
|
+
"span",
|
|
161
|
+
{
|
|
162
|
+
"data-slot": "dropdown-menu-shortcut",
|
|
163
|
+
className: styles.shortcut({ className }),
|
|
164
|
+
...props
|
|
165
|
+
}
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
function DropdownMenuSub({ ...props }) {
|
|
169
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Sub, { "data-slot": "dropdown-menu-sub", ...props });
|
|
170
|
+
}
|
|
171
|
+
function DropdownMenuSubTrigger({
|
|
172
|
+
className,
|
|
173
|
+
inset,
|
|
174
|
+
children,
|
|
175
|
+
...props
|
|
176
|
+
}) {
|
|
177
|
+
const { styles } = useDropdownMenuContext();
|
|
178
|
+
return /* @__PURE__ */ jsxs(
|
|
179
|
+
DropdownMenuPrimitive.SubTrigger,
|
|
180
|
+
{
|
|
181
|
+
"data-slot": "dropdown-menu-sub-trigger",
|
|
182
|
+
"data-inset": dataAttr(inset),
|
|
183
|
+
className: styles.subTrigger({ className }),
|
|
184
|
+
...props,
|
|
185
|
+
children: [
|
|
186
|
+
children,
|
|
187
|
+
/* @__PURE__ */ jsx(ChevronRightIcon, { className: styles.subTriggerIcon() })
|
|
188
|
+
]
|
|
189
|
+
}
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
function DropdownMenuSubContent({
|
|
193
|
+
className,
|
|
194
|
+
...props
|
|
195
|
+
}) {
|
|
196
|
+
const { styles } = useDropdownMenuContext();
|
|
197
|
+
return /* @__PURE__ */ jsx(
|
|
198
|
+
DropdownMenuPrimitive.SubContent,
|
|
199
|
+
{
|
|
200
|
+
"data-slot": "dropdown-menu-sub-content",
|
|
201
|
+
className: styles.subContent({ className }),
|
|
202
|
+
...props
|
|
203
|
+
}
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export {
|
|
208
|
+
__export,
|
|
209
|
+
DropdownMenuRoot,
|
|
210
|
+
DropdownMenuPortal,
|
|
211
|
+
DropdownMenuTrigger,
|
|
212
|
+
DropdownMenuContent,
|
|
213
|
+
DropdownMenuGroup,
|
|
214
|
+
DropdownMenuItem,
|
|
215
|
+
DropdownMenuCheckboxItem,
|
|
216
|
+
DropdownMenuRadioGroup,
|
|
217
|
+
DropdownMenuRadioItem,
|
|
218
|
+
DropdownMenuLabel,
|
|
219
|
+
DropdownMenuSeparator,
|
|
220
|
+
DropdownMenuShortcut,
|
|
221
|
+
DropdownMenuSub,
|
|
222
|
+
DropdownMenuSubTrigger,
|
|
223
|
+
DropdownMenuSubContent
|
|
224
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
DropdownMenuCheckboxItem,
|
|
4
|
+
DropdownMenuContent,
|
|
5
|
+
DropdownMenuGroup,
|
|
6
|
+
DropdownMenuItem,
|
|
7
|
+
DropdownMenuLabel,
|
|
8
|
+
DropdownMenuPortal,
|
|
9
|
+
DropdownMenuRadioGroup,
|
|
10
|
+
DropdownMenuRadioItem,
|
|
11
|
+
DropdownMenuRoot,
|
|
12
|
+
DropdownMenuSeparator,
|
|
13
|
+
DropdownMenuShortcut,
|
|
14
|
+
DropdownMenuSub,
|
|
15
|
+
DropdownMenuSubContent,
|
|
16
|
+
DropdownMenuSubTrigger,
|
|
17
|
+
DropdownMenuTrigger,
|
|
18
|
+
__export
|
|
19
|
+
} from "./chunk-NF4CISAE.mjs";
|
|
20
|
+
|
|
21
|
+
// src/namespace.ts
|
|
22
|
+
var namespace_exports = {};
|
|
23
|
+
__export(namespace_exports, {
|
|
24
|
+
CheckboxItem: () => DropdownMenuCheckboxItem,
|
|
25
|
+
Content: () => DropdownMenuContent,
|
|
26
|
+
Group: () => DropdownMenuGroup,
|
|
27
|
+
Item: () => DropdownMenuItem,
|
|
28
|
+
Label: () => DropdownMenuLabel,
|
|
29
|
+
Portal: () => DropdownMenuPortal,
|
|
30
|
+
RadioGroup: () => DropdownMenuRadioGroup,
|
|
31
|
+
RadioItem: () => DropdownMenuRadioItem,
|
|
32
|
+
Root: () => DropdownMenuRoot,
|
|
33
|
+
Separator: () => DropdownMenuSeparator,
|
|
34
|
+
Shortcut: () => DropdownMenuShortcut,
|
|
35
|
+
Sub: () => DropdownMenuSub,
|
|
36
|
+
SubContent: () => DropdownMenuSubContent,
|
|
37
|
+
SubTrigger: () => DropdownMenuSubTrigger,
|
|
38
|
+
Trigger: () => DropdownMenuTrigger
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
namespace_exports
|
|
43
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
3
|
+
import { ComponentProps } from 'react';
|
|
4
|
+
|
|
5
|
+
type DropdownMenuRootProps = ComponentProps<typeof DropdownMenuPrimitive.Root>;
|
|
6
|
+
declare function DropdownMenuRoot(props: DropdownMenuRootProps): react_jsx_runtime.JSX.Element;
|
|
7
|
+
type DropdownMenuPortalProps = React.ComponentProps<typeof DropdownMenuPrimitive.Portal>;
|
|
8
|
+
declare function DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): react_jsx_runtime.JSX.Element;
|
|
9
|
+
type DropdownMenuTriggerProps = React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>;
|
|
10
|
+
declare function DropdownMenuTrigger({ ...props }: DropdownMenuTriggerProps): react_jsx_runtime.JSX.Element;
|
|
11
|
+
type DropdownMenuContentProps = React.ComponentProps<typeof DropdownMenuPrimitive.Content>;
|
|
12
|
+
declare function DropdownMenuContent({ className, sideOffset, ...props }: DropdownMenuContentProps): react_jsx_runtime.JSX.Element;
|
|
13
|
+
type DropdownMenuGroupProps = React.ComponentProps<typeof DropdownMenuPrimitive.Group>;
|
|
14
|
+
declare function DropdownMenuGroup({ ...props }: DropdownMenuGroupProps): react_jsx_runtime.JSX.Element;
|
|
15
|
+
type DropdownMenuItemProps = React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
16
|
+
inset?: boolean;
|
|
17
|
+
variant?: "default" | "destructive";
|
|
18
|
+
};
|
|
19
|
+
declare function DropdownMenuItem({ className, inset, variant, ...props }: DropdownMenuItemProps): react_jsx_runtime.JSX.Element;
|
|
20
|
+
type DropdownMenuCheckboxItemProps = React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>;
|
|
21
|
+
declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }: DropdownMenuCheckboxItemProps): react_jsx_runtime.JSX.Element;
|
|
22
|
+
type DropdownMenuRadioGroupProps = React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>;
|
|
23
|
+
declare function DropdownMenuRadioGroup({ ...props }: DropdownMenuRadioGroupProps): react_jsx_runtime.JSX.Element;
|
|
24
|
+
type DropdownMenuRadioItemProps = React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>;
|
|
25
|
+
declare function DropdownMenuRadioItem({ className, children, ...props }: DropdownMenuRadioItemProps): react_jsx_runtime.JSX.Element;
|
|
26
|
+
type DropdownMenuLabelProps = React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
27
|
+
inset?: boolean;
|
|
28
|
+
};
|
|
29
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: DropdownMenuLabelProps): react_jsx_runtime.JSX.Element;
|
|
30
|
+
type DropdownMenuSeparatorProps = React.ComponentProps<typeof DropdownMenuPrimitive.Separator>;
|
|
31
|
+
declare function DropdownMenuSeparator({ className, ...props }: DropdownMenuSeparatorProps): react_jsx_runtime.JSX.Element;
|
|
32
|
+
type DropdownMenuItemShortcutProps = React.ComponentProps<"span">;
|
|
33
|
+
declare function DropdownMenuShortcut({ className, ...props }: DropdownMenuItemShortcutProps): react_jsx_runtime.JSX.Element;
|
|
34
|
+
type DropdownMenuSubProps = React.ComponentProps<typeof DropdownMenuPrimitive.Sub>;
|
|
35
|
+
declare function DropdownMenuSub({ ...props }: DropdownMenuSubProps): react_jsx_runtime.JSX.Element;
|
|
36
|
+
type DropdownMenuSubTriggerProps = React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
37
|
+
inset?: boolean;
|
|
38
|
+
};
|
|
39
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: DropdownMenuSubTriggerProps): react_jsx_runtime.JSX.Element;
|
|
40
|
+
type DropdownMenuSubContentProps = React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>;
|
|
41
|
+
declare function DropdownMenuSubContent({ className, ...props }: DropdownMenuSubContentProps): react_jsx_runtime.JSX.Element;
|
|
42
|
+
|
|
43
|
+
export { DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, type DropdownMenuGroupProps, DropdownMenuItem, type DropdownMenuItemProps, type DropdownMenuItemShortcutProps, DropdownMenuLabel, type DropdownMenuLabelProps, DropdownMenuPortal, type DropdownMenuPortalProps, DropdownMenuRadioGroup, type DropdownMenuRadioGroupProps, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuRoot, type DropdownMenuRootProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, type DropdownMenuSubContentProps, type DropdownMenuSubProps, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, type DropdownMenuTriggerProps };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
3
|
+
import { ComponentProps } from 'react';
|
|
4
|
+
|
|
5
|
+
type DropdownMenuRootProps = ComponentProps<typeof DropdownMenuPrimitive.Root>;
|
|
6
|
+
declare function DropdownMenuRoot(props: DropdownMenuRootProps): react_jsx_runtime.JSX.Element;
|
|
7
|
+
type DropdownMenuPortalProps = React.ComponentProps<typeof DropdownMenuPrimitive.Portal>;
|
|
8
|
+
declare function DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): react_jsx_runtime.JSX.Element;
|
|
9
|
+
type DropdownMenuTriggerProps = React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>;
|
|
10
|
+
declare function DropdownMenuTrigger({ ...props }: DropdownMenuTriggerProps): react_jsx_runtime.JSX.Element;
|
|
11
|
+
type DropdownMenuContentProps = React.ComponentProps<typeof DropdownMenuPrimitive.Content>;
|
|
12
|
+
declare function DropdownMenuContent({ className, sideOffset, ...props }: DropdownMenuContentProps): react_jsx_runtime.JSX.Element;
|
|
13
|
+
type DropdownMenuGroupProps = React.ComponentProps<typeof DropdownMenuPrimitive.Group>;
|
|
14
|
+
declare function DropdownMenuGroup({ ...props }: DropdownMenuGroupProps): react_jsx_runtime.JSX.Element;
|
|
15
|
+
type DropdownMenuItemProps = React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
16
|
+
inset?: boolean;
|
|
17
|
+
variant?: "default" | "destructive";
|
|
18
|
+
};
|
|
19
|
+
declare function DropdownMenuItem({ className, inset, variant, ...props }: DropdownMenuItemProps): react_jsx_runtime.JSX.Element;
|
|
20
|
+
type DropdownMenuCheckboxItemProps = React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>;
|
|
21
|
+
declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }: DropdownMenuCheckboxItemProps): react_jsx_runtime.JSX.Element;
|
|
22
|
+
type DropdownMenuRadioGroupProps = React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>;
|
|
23
|
+
declare function DropdownMenuRadioGroup({ ...props }: DropdownMenuRadioGroupProps): react_jsx_runtime.JSX.Element;
|
|
24
|
+
type DropdownMenuRadioItemProps = React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>;
|
|
25
|
+
declare function DropdownMenuRadioItem({ className, children, ...props }: DropdownMenuRadioItemProps): react_jsx_runtime.JSX.Element;
|
|
26
|
+
type DropdownMenuLabelProps = React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
27
|
+
inset?: boolean;
|
|
28
|
+
};
|
|
29
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: DropdownMenuLabelProps): react_jsx_runtime.JSX.Element;
|
|
30
|
+
type DropdownMenuSeparatorProps = React.ComponentProps<typeof DropdownMenuPrimitive.Separator>;
|
|
31
|
+
declare function DropdownMenuSeparator({ className, ...props }: DropdownMenuSeparatorProps): react_jsx_runtime.JSX.Element;
|
|
32
|
+
type DropdownMenuItemShortcutProps = React.ComponentProps<"span">;
|
|
33
|
+
declare function DropdownMenuShortcut({ className, ...props }: DropdownMenuItemShortcutProps): react_jsx_runtime.JSX.Element;
|
|
34
|
+
type DropdownMenuSubProps = React.ComponentProps<typeof DropdownMenuPrimitive.Sub>;
|
|
35
|
+
declare function DropdownMenuSub({ ...props }: DropdownMenuSubProps): react_jsx_runtime.JSX.Element;
|
|
36
|
+
type DropdownMenuSubTriggerProps = React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
37
|
+
inset?: boolean;
|
|
38
|
+
};
|
|
39
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: DropdownMenuSubTriggerProps): react_jsx_runtime.JSX.Element;
|
|
40
|
+
type DropdownMenuSubContentProps = React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>;
|
|
41
|
+
declare function DropdownMenuSubContent({ className, ...props }: DropdownMenuSubContentProps): react_jsx_runtime.JSX.Element;
|
|
42
|
+
|
|
43
|
+
export { DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, type DropdownMenuGroupProps, DropdownMenuItem, type DropdownMenuItemProps, type DropdownMenuItemShortcutProps, DropdownMenuLabel, type DropdownMenuLabelProps, DropdownMenuPortal, type DropdownMenuPortalProps, DropdownMenuRadioGroup, type DropdownMenuRadioGroupProps, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuRoot, type DropdownMenuRootProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, type DropdownMenuSubContentProps, type DropdownMenuSubProps, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, type DropdownMenuTriggerProps };
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
|
|
31
|
+
// src/dropdown-menu.tsx
|
|
32
|
+
var dropdown_menu_exports = {};
|
|
33
|
+
__export(dropdown_menu_exports, {
|
|
34
|
+
DropdownMenuCheckboxItem: () => DropdownMenuCheckboxItem,
|
|
35
|
+
DropdownMenuContent: () => DropdownMenuContent,
|
|
36
|
+
DropdownMenuGroup: () => DropdownMenuGroup,
|
|
37
|
+
DropdownMenuItem: () => DropdownMenuItem,
|
|
38
|
+
DropdownMenuLabel: () => DropdownMenuLabel,
|
|
39
|
+
DropdownMenuPortal: () => DropdownMenuPortal,
|
|
40
|
+
DropdownMenuRadioGroup: () => DropdownMenuRadioGroup,
|
|
41
|
+
DropdownMenuRadioItem: () => DropdownMenuRadioItem,
|
|
42
|
+
DropdownMenuRoot: () => DropdownMenuRoot,
|
|
43
|
+
DropdownMenuSeparator: () => DropdownMenuSeparator,
|
|
44
|
+
DropdownMenuShortcut: () => DropdownMenuShortcut,
|
|
45
|
+
DropdownMenuSub: () => DropdownMenuSub,
|
|
46
|
+
DropdownMenuSubContent: () => DropdownMenuSubContent,
|
|
47
|
+
DropdownMenuSubTrigger: () => DropdownMenuSubTrigger,
|
|
48
|
+
DropdownMenuTrigger: () => DropdownMenuTrigger
|
|
49
|
+
});
|
|
50
|
+
module.exports = __toCommonJS(dropdown_menu_exports);
|
|
51
|
+
var import_icons = require("@kopexa/icons");
|
|
52
|
+
var import_react_utils = require("@kopexa/react-utils");
|
|
53
|
+
var import_shared_utils = require("@kopexa/shared-utils");
|
|
54
|
+
var import_theme = require("@kopexa/theme");
|
|
55
|
+
var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
56
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
57
|
+
var [Provider, useDropdownMenuContext] = (0, import_react_utils.createContext)();
|
|
58
|
+
function DropdownMenuRoot(props) {
|
|
59
|
+
const styles = (0, import_theme.dropdownMenu)();
|
|
60
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Provider, { value: { styles }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props }) });
|
|
61
|
+
}
|
|
62
|
+
function DropdownMenuPortal({
|
|
63
|
+
...props
|
|
64
|
+
}) {
|
|
65
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuPrimitive.Portal, { "data-slot": "dropdown-menu-portal", ...props });
|
|
66
|
+
}
|
|
67
|
+
function DropdownMenuTrigger({ ...props }) {
|
|
68
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
69
|
+
DropdownMenuPrimitive.Trigger,
|
|
70
|
+
{
|
|
71
|
+
"data-slot": "dropdown-menu-trigger",
|
|
72
|
+
...props
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
function DropdownMenuContent({
|
|
77
|
+
className,
|
|
78
|
+
sideOffset = 4,
|
|
79
|
+
...props
|
|
80
|
+
}) {
|
|
81
|
+
const styles = (0, import_theme.dropdownMenu)();
|
|
82
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
83
|
+
DropdownMenuPrimitive.Content,
|
|
84
|
+
{
|
|
85
|
+
"data-slot": "dropdown-menu-content",
|
|
86
|
+
sideOffset,
|
|
87
|
+
className: styles.content({ className }),
|
|
88
|
+
...props
|
|
89
|
+
}
|
|
90
|
+
) });
|
|
91
|
+
}
|
|
92
|
+
function DropdownMenuGroup({ ...props }) {
|
|
93
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props });
|
|
94
|
+
}
|
|
95
|
+
function DropdownMenuItem({
|
|
96
|
+
className,
|
|
97
|
+
inset,
|
|
98
|
+
variant = "default",
|
|
99
|
+
...props
|
|
100
|
+
}) {
|
|
101
|
+
const { styles } = useDropdownMenuContext();
|
|
102
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
103
|
+
DropdownMenuPrimitive.Item,
|
|
104
|
+
{
|
|
105
|
+
"data-slot": "dropdown-menu-item",
|
|
106
|
+
"data-inset": inset,
|
|
107
|
+
"data-variant": variant,
|
|
108
|
+
className: styles.item({
|
|
109
|
+
className
|
|
110
|
+
}),
|
|
111
|
+
...props
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
function DropdownMenuCheckboxItem({
|
|
116
|
+
className,
|
|
117
|
+
children,
|
|
118
|
+
checked,
|
|
119
|
+
...props
|
|
120
|
+
}) {
|
|
121
|
+
const { styles } = useDropdownMenuContext();
|
|
122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
123
|
+
DropdownMenuPrimitive.CheckboxItem,
|
|
124
|
+
{
|
|
125
|
+
"data-slot": "dropdown-menu-checkbox-item",
|
|
126
|
+
className: styles.checkboxItem({ className }),
|
|
127
|
+
checked,
|
|
128
|
+
...props,
|
|
129
|
+
children: [
|
|
130
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: styles.iconWrapper(), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CheckIcon, { className: styles.icon() }) }) }),
|
|
131
|
+
children
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
function DropdownMenuRadioGroup({
|
|
137
|
+
...props
|
|
138
|
+
}) {
|
|
139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
140
|
+
DropdownMenuPrimitive.RadioGroup,
|
|
141
|
+
{
|
|
142
|
+
"data-slot": "dropdown-menu-radio-group",
|
|
143
|
+
...props
|
|
144
|
+
}
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
function DropdownMenuRadioItem({
|
|
148
|
+
className,
|
|
149
|
+
children,
|
|
150
|
+
...props
|
|
151
|
+
}) {
|
|
152
|
+
const { styles } = useDropdownMenuContext();
|
|
153
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
154
|
+
DropdownMenuPrimitive.RadioItem,
|
|
155
|
+
{
|
|
156
|
+
"data-slot": "dropdown-menu-radio-item",
|
|
157
|
+
className: styles.radioItem({ className }),
|
|
158
|
+
...props,
|
|
159
|
+
children: [
|
|
160
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: styles.iconWrapper(), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CircleIcon, { className: styles.radioItemIcon() }) }) }),
|
|
161
|
+
children
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
function DropdownMenuLabel({
|
|
167
|
+
className,
|
|
168
|
+
inset,
|
|
169
|
+
...props
|
|
170
|
+
}) {
|
|
171
|
+
const { styles } = useDropdownMenuContext();
|
|
172
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
173
|
+
DropdownMenuPrimitive.Label,
|
|
174
|
+
{
|
|
175
|
+
"data-slot": "dropdown-menu-label",
|
|
176
|
+
"data-inset": inset,
|
|
177
|
+
className: styles.label({ className }),
|
|
178
|
+
...props
|
|
179
|
+
}
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
function DropdownMenuSeparator({
|
|
183
|
+
className,
|
|
184
|
+
...props
|
|
185
|
+
}) {
|
|
186
|
+
const { styles } = useDropdownMenuContext();
|
|
187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
188
|
+
DropdownMenuPrimitive.Separator,
|
|
189
|
+
{
|
|
190
|
+
"data-slot": "dropdown-menu-separator",
|
|
191
|
+
className: styles.separator({ className }),
|
|
192
|
+
...props
|
|
193
|
+
}
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
function DropdownMenuShortcut({
|
|
197
|
+
className,
|
|
198
|
+
...props
|
|
199
|
+
}) {
|
|
200
|
+
const { styles } = useDropdownMenuContext();
|
|
201
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
202
|
+
"span",
|
|
203
|
+
{
|
|
204
|
+
"data-slot": "dropdown-menu-shortcut",
|
|
205
|
+
className: styles.shortcut({ className }),
|
|
206
|
+
...props
|
|
207
|
+
}
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
function DropdownMenuSub({ ...props }) {
|
|
211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuPrimitive.Sub, { "data-slot": "dropdown-menu-sub", ...props });
|
|
212
|
+
}
|
|
213
|
+
function DropdownMenuSubTrigger({
|
|
214
|
+
className,
|
|
215
|
+
inset,
|
|
216
|
+
children,
|
|
217
|
+
...props
|
|
218
|
+
}) {
|
|
219
|
+
const { styles } = useDropdownMenuContext();
|
|
220
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
221
|
+
DropdownMenuPrimitive.SubTrigger,
|
|
222
|
+
{
|
|
223
|
+
"data-slot": "dropdown-menu-sub-trigger",
|
|
224
|
+
"data-inset": (0, import_shared_utils.dataAttr)(inset),
|
|
225
|
+
className: styles.subTrigger({ className }),
|
|
226
|
+
...props,
|
|
227
|
+
children: [
|
|
228
|
+
children,
|
|
229
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.ChevronRightIcon, { className: styles.subTriggerIcon() })
|
|
230
|
+
]
|
|
231
|
+
}
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
function DropdownMenuSubContent({
|
|
235
|
+
className,
|
|
236
|
+
...props
|
|
237
|
+
}) {
|
|
238
|
+
const { styles } = useDropdownMenuContext();
|
|
239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
240
|
+
DropdownMenuPrimitive.SubContent,
|
|
241
|
+
{
|
|
242
|
+
"data-slot": "dropdown-menu-sub-content",
|
|
243
|
+
className: styles.subContent({ className }),
|
|
244
|
+
...props
|
|
245
|
+
}
|
|
246
|
+
);
|
|
247
|
+
}
|
|
248
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
249
|
+
0 && (module.exports = {
|
|
250
|
+
DropdownMenuCheckboxItem,
|
|
251
|
+
DropdownMenuContent,
|
|
252
|
+
DropdownMenuGroup,
|
|
253
|
+
DropdownMenuItem,
|
|
254
|
+
DropdownMenuLabel,
|
|
255
|
+
DropdownMenuPortal,
|
|
256
|
+
DropdownMenuRadioGroup,
|
|
257
|
+
DropdownMenuRadioItem,
|
|
258
|
+
DropdownMenuRoot,
|
|
259
|
+
DropdownMenuSeparator,
|
|
260
|
+
DropdownMenuShortcut,
|
|
261
|
+
DropdownMenuSub,
|
|
262
|
+
DropdownMenuSubContent,
|
|
263
|
+
DropdownMenuSubTrigger,
|
|
264
|
+
DropdownMenuTrigger
|
|
265
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
DropdownMenuCheckboxItem,
|
|
4
|
+
DropdownMenuContent,
|
|
5
|
+
DropdownMenuGroup,
|
|
6
|
+
DropdownMenuItem,
|
|
7
|
+
DropdownMenuLabel,
|
|
8
|
+
DropdownMenuPortal,
|
|
9
|
+
DropdownMenuRadioGroup,
|
|
10
|
+
DropdownMenuRadioItem,
|
|
11
|
+
DropdownMenuRoot,
|
|
12
|
+
DropdownMenuSeparator,
|
|
13
|
+
DropdownMenuShortcut,
|
|
14
|
+
DropdownMenuSub,
|
|
15
|
+
DropdownMenuSubContent,
|
|
16
|
+
DropdownMenuSubTrigger,
|
|
17
|
+
DropdownMenuTrigger
|
|
18
|
+
} from "./chunk-NF4CISAE.mjs";
|
|
19
|
+
export {
|
|
20
|
+
DropdownMenuCheckboxItem,
|
|
21
|
+
DropdownMenuContent,
|
|
22
|
+
DropdownMenuGroup,
|
|
23
|
+
DropdownMenuItem,
|
|
24
|
+
DropdownMenuLabel,
|
|
25
|
+
DropdownMenuPortal,
|
|
26
|
+
DropdownMenuRadioGroup,
|
|
27
|
+
DropdownMenuRadioItem,
|
|
28
|
+
DropdownMenuRoot,
|
|
29
|
+
DropdownMenuSeparator,
|
|
30
|
+
DropdownMenuShortcut,
|
|
31
|
+
DropdownMenuSub,
|
|
32
|
+
DropdownMenuSubContent,
|
|
33
|
+
DropdownMenuSubTrigger,
|
|
34
|
+
DropdownMenuTrigger
|
|
35
|
+
};
|
package/dist/index.d.mts
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
|
|
31
|
+
// src/index.ts
|
|
32
|
+
var index_exports = {};
|
|
33
|
+
__export(index_exports, {
|
|
34
|
+
DropdownMenu: () => namespace_exports
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(index_exports);
|
|
37
|
+
|
|
38
|
+
// src/namespace.ts
|
|
39
|
+
var namespace_exports = {};
|
|
40
|
+
__export(namespace_exports, {
|
|
41
|
+
CheckboxItem: () => DropdownMenuCheckboxItem,
|
|
42
|
+
Content: () => DropdownMenuContent,
|
|
43
|
+
Group: () => DropdownMenuGroup,
|
|
44
|
+
Item: () => DropdownMenuItem,
|
|
45
|
+
Label: () => DropdownMenuLabel,
|
|
46
|
+
Portal: () => DropdownMenuPortal,
|
|
47
|
+
RadioGroup: () => DropdownMenuRadioGroup,
|
|
48
|
+
RadioItem: () => DropdownMenuRadioItem,
|
|
49
|
+
Root: () => DropdownMenuRoot,
|
|
50
|
+
Separator: () => DropdownMenuSeparator,
|
|
51
|
+
Shortcut: () => DropdownMenuShortcut,
|
|
52
|
+
Sub: () => DropdownMenuSub,
|
|
53
|
+
SubContent: () => DropdownMenuSubContent,
|
|
54
|
+
SubTrigger: () => DropdownMenuSubTrigger,
|
|
55
|
+
Trigger: () => DropdownMenuTrigger
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
// src/dropdown-menu.tsx
|
|
59
|
+
var import_icons = require("@kopexa/icons");
|
|
60
|
+
var import_react_utils = require("@kopexa/react-utils");
|
|
61
|
+
var import_shared_utils = require("@kopexa/shared-utils");
|
|
62
|
+
var import_theme = require("@kopexa/theme");
|
|
63
|
+
var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
64
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
65
|
+
var [Provider, useDropdownMenuContext] = (0, import_react_utils.createContext)();
|
|
66
|
+
function DropdownMenuRoot(props) {
|
|
67
|
+
const styles = (0, import_theme.dropdownMenu)();
|
|
68
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Provider, { value: { styles }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props }) });
|
|
69
|
+
}
|
|
70
|
+
function DropdownMenuPortal({
|
|
71
|
+
...props
|
|
72
|
+
}) {
|
|
73
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuPrimitive.Portal, { "data-slot": "dropdown-menu-portal", ...props });
|
|
74
|
+
}
|
|
75
|
+
function DropdownMenuTrigger({ ...props }) {
|
|
76
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
77
|
+
DropdownMenuPrimitive.Trigger,
|
|
78
|
+
{
|
|
79
|
+
"data-slot": "dropdown-menu-trigger",
|
|
80
|
+
...props
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
function DropdownMenuContent({
|
|
85
|
+
className,
|
|
86
|
+
sideOffset = 4,
|
|
87
|
+
...props
|
|
88
|
+
}) {
|
|
89
|
+
const styles = (0, import_theme.dropdownMenu)();
|
|
90
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
91
|
+
DropdownMenuPrimitive.Content,
|
|
92
|
+
{
|
|
93
|
+
"data-slot": "dropdown-menu-content",
|
|
94
|
+
sideOffset,
|
|
95
|
+
className: styles.content({ className }),
|
|
96
|
+
...props
|
|
97
|
+
}
|
|
98
|
+
) });
|
|
99
|
+
}
|
|
100
|
+
function DropdownMenuGroup({ ...props }) {
|
|
101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props });
|
|
102
|
+
}
|
|
103
|
+
function DropdownMenuItem({
|
|
104
|
+
className,
|
|
105
|
+
inset,
|
|
106
|
+
variant = "default",
|
|
107
|
+
...props
|
|
108
|
+
}) {
|
|
109
|
+
const { styles } = useDropdownMenuContext();
|
|
110
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
111
|
+
DropdownMenuPrimitive.Item,
|
|
112
|
+
{
|
|
113
|
+
"data-slot": "dropdown-menu-item",
|
|
114
|
+
"data-inset": inset,
|
|
115
|
+
"data-variant": variant,
|
|
116
|
+
className: styles.item({
|
|
117
|
+
className
|
|
118
|
+
}),
|
|
119
|
+
...props
|
|
120
|
+
}
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
function DropdownMenuCheckboxItem({
|
|
124
|
+
className,
|
|
125
|
+
children,
|
|
126
|
+
checked,
|
|
127
|
+
...props
|
|
128
|
+
}) {
|
|
129
|
+
const { styles } = useDropdownMenuContext();
|
|
130
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
131
|
+
DropdownMenuPrimitive.CheckboxItem,
|
|
132
|
+
{
|
|
133
|
+
"data-slot": "dropdown-menu-checkbox-item",
|
|
134
|
+
className: styles.checkboxItem({ className }),
|
|
135
|
+
checked,
|
|
136
|
+
...props,
|
|
137
|
+
children: [
|
|
138
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: styles.iconWrapper(), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CheckIcon, { className: styles.icon() }) }) }),
|
|
139
|
+
children
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
function DropdownMenuRadioGroup({
|
|
145
|
+
...props
|
|
146
|
+
}) {
|
|
147
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
148
|
+
DropdownMenuPrimitive.RadioGroup,
|
|
149
|
+
{
|
|
150
|
+
"data-slot": "dropdown-menu-radio-group",
|
|
151
|
+
...props
|
|
152
|
+
}
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
function DropdownMenuRadioItem({
|
|
156
|
+
className,
|
|
157
|
+
children,
|
|
158
|
+
...props
|
|
159
|
+
}) {
|
|
160
|
+
const { styles } = useDropdownMenuContext();
|
|
161
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
162
|
+
DropdownMenuPrimitive.RadioItem,
|
|
163
|
+
{
|
|
164
|
+
"data-slot": "dropdown-menu-radio-item",
|
|
165
|
+
className: styles.radioItem({ className }),
|
|
166
|
+
...props,
|
|
167
|
+
children: [
|
|
168
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: styles.iconWrapper(), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CircleIcon, { className: styles.radioItemIcon() }) }) }),
|
|
169
|
+
children
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
function DropdownMenuLabel({
|
|
175
|
+
className,
|
|
176
|
+
inset,
|
|
177
|
+
...props
|
|
178
|
+
}) {
|
|
179
|
+
const { styles } = useDropdownMenuContext();
|
|
180
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
181
|
+
DropdownMenuPrimitive.Label,
|
|
182
|
+
{
|
|
183
|
+
"data-slot": "dropdown-menu-label",
|
|
184
|
+
"data-inset": inset,
|
|
185
|
+
className: styles.label({ className }),
|
|
186
|
+
...props
|
|
187
|
+
}
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
function DropdownMenuSeparator({
|
|
191
|
+
className,
|
|
192
|
+
...props
|
|
193
|
+
}) {
|
|
194
|
+
const { styles } = useDropdownMenuContext();
|
|
195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
196
|
+
DropdownMenuPrimitive.Separator,
|
|
197
|
+
{
|
|
198
|
+
"data-slot": "dropdown-menu-separator",
|
|
199
|
+
className: styles.separator({ className }),
|
|
200
|
+
...props
|
|
201
|
+
}
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
function DropdownMenuShortcut({
|
|
205
|
+
className,
|
|
206
|
+
...props
|
|
207
|
+
}) {
|
|
208
|
+
const { styles } = useDropdownMenuContext();
|
|
209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
210
|
+
"span",
|
|
211
|
+
{
|
|
212
|
+
"data-slot": "dropdown-menu-shortcut",
|
|
213
|
+
className: styles.shortcut({ className }),
|
|
214
|
+
...props
|
|
215
|
+
}
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
function DropdownMenuSub({ ...props }) {
|
|
219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuPrimitive.Sub, { "data-slot": "dropdown-menu-sub", ...props });
|
|
220
|
+
}
|
|
221
|
+
function DropdownMenuSubTrigger({
|
|
222
|
+
className,
|
|
223
|
+
inset,
|
|
224
|
+
children,
|
|
225
|
+
...props
|
|
226
|
+
}) {
|
|
227
|
+
const { styles } = useDropdownMenuContext();
|
|
228
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
229
|
+
DropdownMenuPrimitive.SubTrigger,
|
|
230
|
+
{
|
|
231
|
+
"data-slot": "dropdown-menu-sub-trigger",
|
|
232
|
+
"data-inset": (0, import_shared_utils.dataAttr)(inset),
|
|
233
|
+
className: styles.subTrigger({ className }),
|
|
234
|
+
...props,
|
|
235
|
+
children: [
|
|
236
|
+
children,
|
|
237
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.ChevronRightIcon, { className: styles.subTriggerIcon() })
|
|
238
|
+
]
|
|
239
|
+
}
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
function DropdownMenuSubContent({
|
|
243
|
+
className,
|
|
244
|
+
...props
|
|
245
|
+
}) {
|
|
246
|
+
const { styles } = useDropdownMenuContext();
|
|
247
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
248
|
+
DropdownMenuPrimitive.SubContent,
|
|
249
|
+
{
|
|
250
|
+
"data-slot": "dropdown-menu-sub-content",
|
|
251
|
+
className: styles.subContent({ className }),
|
|
252
|
+
...props
|
|
253
|
+
}
|
|
254
|
+
);
|
|
255
|
+
}
|
|
256
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
257
|
+
0 && (module.exports = {
|
|
258
|
+
DropdownMenu
|
|
259
|
+
});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DropdownMenuCheckboxItem, DropdownMenuCheckboxItemProps, DropdownMenuContent, DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuGroupProps, DropdownMenuItem, DropdownMenuItemProps, DropdownMenuItemShortcutProps, DropdownMenuLabel, DropdownMenuLabelProps, DropdownMenuPortal, DropdownMenuPortalProps, DropdownMenuRadioGroup, DropdownMenuRadioGroupProps, DropdownMenuRadioItem, DropdownMenuRadioItemProps, DropdownMenuRoot, DropdownMenuRootProps, DropdownMenuSeparator, DropdownMenuSeparatorProps, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubContentProps, DropdownMenuSubProps, DropdownMenuSubTrigger, DropdownMenuSubTriggerProps, DropdownMenuTrigger, DropdownMenuTriggerProps } from './dropdown-menu.mjs';
|
|
2
|
+
import 'react/jsx-runtime';
|
|
3
|
+
import '@radix-ui/react-dropdown-menu';
|
|
4
|
+
import 'react';
|
|
5
|
+
|
|
6
|
+
declare namespace namespace {
|
|
7
|
+
export { DropdownMenuCheckboxItem as CheckboxItem, DropdownMenuCheckboxItemProps as CheckboxItemProps, DropdownMenuContent as Content, DropdownMenuContentProps as ContentProps, DropdownMenuGroup as Group, DropdownMenuGroupProps as GroupProps, DropdownMenuItem as Item, DropdownMenuItemProps as ItemProps, DropdownMenuItemShortcutProps as ItemShortcutProps, DropdownMenuLabel as Label, DropdownMenuLabelProps as LabelProps, DropdownMenuPortal as Portal, DropdownMenuPortalProps as PortalProps, DropdownMenuRadioGroup as RadioGroup, DropdownMenuRadioGroupProps as RadioGroupProps, DropdownMenuRadioItem as RadioItem, DropdownMenuRadioItemProps as RadioItemProps, DropdownMenuRoot as Root, DropdownMenuRootProps as RootProps, DropdownMenuSeparator as Separator, DropdownMenuSeparatorProps as SeparatorProps, DropdownMenuShortcut as Shortcut, DropdownMenuSub as Sub, DropdownMenuSubContent as SubContent, DropdownMenuSubContentProps as SubContentProps, DropdownMenuSubProps as SubProps, DropdownMenuSubTrigger as SubTrigger, DropdownMenuSubTriggerProps as SubTriggerProps, DropdownMenuTrigger as Trigger, DropdownMenuTriggerProps as TriggerProps };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { DropdownMenuCheckboxItem as CheckboxItem, DropdownMenuCheckboxItemProps as CheckboxItemProps, DropdownMenuContent as Content, DropdownMenuContentProps as ContentProps, DropdownMenuGroup as Group, DropdownMenuGroupProps as GroupProps, DropdownMenuItem as Item, DropdownMenuItemProps as ItemProps, DropdownMenuItemShortcutProps as ItemShortcutProps, DropdownMenuLabel as Label, DropdownMenuLabelProps as LabelProps, DropdownMenuPortal as Portal, DropdownMenuPortalProps as PortalProps, DropdownMenuRadioGroup as RadioGroup, DropdownMenuRadioGroupProps as RadioGroupProps, DropdownMenuRadioItem as RadioItem, DropdownMenuRadioItemProps as RadioItemProps, DropdownMenuRoot as Root, DropdownMenuRootProps as RootProps, DropdownMenuSeparator as Separator, DropdownMenuSeparatorProps as SeparatorProps, DropdownMenuShortcut as Shortcut, DropdownMenuSub as Sub, DropdownMenuSubContent as SubContent, DropdownMenuSubContentProps as SubContentProps, DropdownMenuSubProps as SubProps, DropdownMenuSubTrigger as SubTrigger, DropdownMenuSubTriggerProps as SubTriggerProps, DropdownMenuTrigger as Trigger, DropdownMenuTriggerProps as TriggerProps, namespace as n };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DropdownMenuCheckboxItem, DropdownMenuCheckboxItemProps, DropdownMenuContent, DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuGroupProps, DropdownMenuItem, DropdownMenuItemProps, DropdownMenuItemShortcutProps, DropdownMenuLabel, DropdownMenuLabelProps, DropdownMenuPortal, DropdownMenuPortalProps, DropdownMenuRadioGroup, DropdownMenuRadioGroupProps, DropdownMenuRadioItem, DropdownMenuRadioItemProps, DropdownMenuRoot, DropdownMenuRootProps, DropdownMenuSeparator, DropdownMenuSeparatorProps, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubContentProps, DropdownMenuSubProps, DropdownMenuSubTrigger, DropdownMenuSubTriggerProps, DropdownMenuTrigger, DropdownMenuTriggerProps } from './dropdown-menu.js';
|
|
2
|
+
import 'react/jsx-runtime';
|
|
3
|
+
import '@radix-ui/react-dropdown-menu';
|
|
4
|
+
import 'react';
|
|
5
|
+
|
|
6
|
+
declare namespace namespace {
|
|
7
|
+
export { DropdownMenuCheckboxItem as CheckboxItem, DropdownMenuCheckboxItemProps as CheckboxItemProps, DropdownMenuContent as Content, DropdownMenuContentProps as ContentProps, DropdownMenuGroup as Group, DropdownMenuGroupProps as GroupProps, DropdownMenuItem as Item, DropdownMenuItemProps as ItemProps, DropdownMenuItemShortcutProps as ItemShortcutProps, DropdownMenuLabel as Label, DropdownMenuLabelProps as LabelProps, DropdownMenuPortal as Portal, DropdownMenuPortalProps as PortalProps, DropdownMenuRadioGroup as RadioGroup, DropdownMenuRadioGroupProps as RadioGroupProps, DropdownMenuRadioItem as RadioItem, DropdownMenuRadioItemProps as RadioItemProps, DropdownMenuRoot as Root, DropdownMenuRootProps as RootProps, DropdownMenuSeparator as Separator, DropdownMenuSeparatorProps as SeparatorProps, DropdownMenuShortcut as Shortcut, DropdownMenuSub as Sub, DropdownMenuSubContent as SubContent, DropdownMenuSubContentProps as SubContentProps, DropdownMenuSubProps as SubProps, DropdownMenuSubTrigger as SubTrigger, DropdownMenuSubTriggerProps as SubTriggerProps, DropdownMenuTrigger as Trigger, DropdownMenuTriggerProps as TriggerProps };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { DropdownMenuCheckboxItem as CheckboxItem, DropdownMenuCheckboxItemProps as CheckboxItemProps, DropdownMenuContent as Content, DropdownMenuContentProps as ContentProps, DropdownMenuGroup as Group, DropdownMenuGroupProps as GroupProps, DropdownMenuItem as Item, DropdownMenuItemProps as ItemProps, DropdownMenuItemShortcutProps as ItemShortcutProps, DropdownMenuLabel as Label, DropdownMenuLabelProps as LabelProps, DropdownMenuPortal as Portal, DropdownMenuPortalProps as PortalProps, DropdownMenuRadioGroup as RadioGroup, DropdownMenuRadioGroupProps as RadioGroupProps, DropdownMenuRadioItem as RadioItem, DropdownMenuRadioItemProps as RadioItemProps, DropdownMenuRoot as Root, DropdownMenuRootProps as RootProps, DropdownMenuSeparator as Separator, DropdownMenuSeparatorProps as SeparatorProps, DropdownMenuShortcut as Shortcut, DropdownMenuSub as Sub, DropdownMenuSubContent as SubContent, DropdownMenuSubContentProps as SubContentProps, DropdownMenuSubProps as SubProps, DropdownMenuSubTrigger as SubTrigger, DropdownMenuSubTriggerProps as SubTriggerProps, DropdownMenuTrigger as Trigger, DropdownMenuTriggerProps as TriggerProps, namespace as n };
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
|
|
31
|
+
// src/namespace.ts
|
|
32
|
+
var namespace_exports = {};
|
|
33
|
+
__export(namespace_exports, {
|
|
34
|
+
CheckboxItem: () => DropdownMenuCheckboxItem,
|
|
35
|
+
Content: () => DropdownMenuContent,
|
|
36
|
+
Group: () => DropdownMenuGroup,
|
|
37
|
+
Item: () => DropdownMenuItem,
|
|
38
|
+
Label: () => DropdownMenuLabel,
|
|
39
|
+
Portal: () => DropdownMenuPortal,
|
|
40
|
+
RadioGroup: () => DropdownMenuRadioGroup,
|
|
41
|
+
RadioItem: () => DropdownMenuRadioItem,
|
|
42
|
+
Root: () => DropdownMenuRoot,
|
|
43
|
+
Separator: () => DropdownMenuSeparator,
|
|
44
|
+
Shortcut: () => DropdownMenuShortcut,
|
|
45
|
+
Sub: () => DropdownMenuSub,
|
|
46
|
+
SubContent: () => DropdownMenuSubContent,
|
|
47
|
+
SubTrigger: () => DropdownMenuSubTrigger,
|
|
48
|
+
Trigger: () => DropdownMenuTrigger
|
|
49
|
+
});
|
|
50
|
+
module.exports = __toCommonJS(namespace_exports);
|
|
51
|
+
|
|
52
|
+
// src/dropdown-menu.tsx
|
|
53
|
+
var import_icons = require("@kopexa/icons");
|
|
54
|
+
var import_react_utils = require("@kopexa/react-utils");
|
|
55
|
+
var import_shared_utils = require("@kopexa/shared-utils");
|
|
56
|
+
var import_theme = require("@kopexa/theme");
|
|
57
|
+
var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
58
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
59
|
+
var [Provider, useDropdownMenuContext] = (0, import_react_utils.createContext)();
|
|
60
|
+
function DropdownMenuRoot(props) {
|
|
61
|
+
const styles = (0, import_theme.dropdownMenu)();
|
|
62
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Provider, { value: { styles }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props }) });
|
|
63
|
+
}
|
|
64
|
+
function DropdownMenuPortal({
|
|
65
|
+
...props
|
|
66
|
+
}) {
|
|
67
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuPrimitive.Portal, { "data-slot": "dropdown-menu-portal", ...props });
|
|
68
|
+
}
|
|
69
|
+
function DropdownMenuTrigger({ ...props }) {
|
|
70
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
71
|
+
DropdownMenuPrimitive.Trigger,
|
|
72
|
+
{
|
|
73
|
+
"data-slot": "dropdown-menu-trigger",
|
|
74
|
+
...props
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
function DropdownMenuContent({
|
|
79
|
+
className,
|
|
80
|
+
sideOffset = 4,
|
|
81
|
+
...props
|
|
82
|
+
}) {
|
|
83
|
+
const styles = (0, import_theme.dropdownMenu)();
|
|
84
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
85
|
+
DropdownMenuPrimitive.Content,
|
|
86
|
+
{
|
|
87
|
+
"data-slot": "dropdown-menu-content",
|
|
88
|
+
sideOffset,
|
|
89
|
+
className: styles.content({ className }),
|
|
90
|
+
...props
|
|
91
|
+
}
|
|
92
|
+
) });
|
|
93
|
+
}
|
|
94
|
+
function DropdownMenuGroup({ ...props }) {
|
|
95
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props });
|
|
96
|
+
}
|
|
97
|
+
function DropdownMenuItem({
|
|
98
|
+
className,
|
|
99
|
+
inset,
|
|
100
|
+
variant = "default",
|
|
101
|
+
...props
|
|
102
|
+
}) {
|
|
103
|
+
const { styles } = useDropdownMenuContext();
|
|
104
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
105
|
+
DropdownMenuPrimitive.Item,
|
|
106
|
+
{
|
|
107
|
+
"data-slot": "dropdown-menu-item",
|
|
108
|
+
"data-inset": inset,
|
|
109
|
+
"data-variant": variant,
|
|
110
|
+
className: styles.item({
|
|
111
|
+
className
|
|
112
|
+
}),
|
|
113
|
+
...props
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
function DropdownMenuCheckboxItem({
|
|
118
|
+
className,
|
|
119
|
+
children,
|
|
120
|
+
checked,
|
|
121
|
+
...props
|
|
122
|
+
}) {
|
|
123
|
+
const { styles } = useDropdownMenuContext();
|
|
124
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
125
|
+
DropdownMenuPrimitive.CheckboxItem,
|
|
126
|
+
{
|
|
127
|
+
"data-slot": "dropdown-menu-checkbox-item",
|
|
128
|
+
className: styles.checkboxItem({ className }),
|
|
129
|
+
checked,
|
|
130
|
+
...props,
|
|
131
|
+
children: [
|
|
132
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: styles.iconWrapper(), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CheckIcon, { className: styles.icon() }) }) }),
|
|
133
|
+
children
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
function DropdownMenuRadioGroup({
|
|
139
|
+
...props
|
|
140
|
+
}) {
|
|
141
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
142
|
+
DropdownMenuPrimitive.RadioGroup,
|
|
143
|
+
{
|
|
144
|
+
"data-slot": "dropdown-menu-radio-group",
|
|
145
|
+
...props
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
function DropdownMenuRadioItem({
|
|
150
|
+
className,
|
|
151
|
+
children,
|
|
152
|
+
...props
|
|
153
|
+
}) {
|
|
154
|
+
const { styles } = useDropdownMenuContext();
|
|
155
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
156
|
+
DropdownMenuPrimitive.RadioItem,
|
|
157
|
+
{
|
|
158
|
+
"data-slot": "dropdown-menu-radio-item",
|
|
159
|
+
className: styles.radioItem({ className }),
|
|
160
|
+
...props,
|
|
161
|
+
children: [
|
|
162
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: styles.iconWrapper(), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CircleIcon, { className: styles.radioItemIcon() }) }) }),
|
|
163
|
+
children
|
|
164
|
+
]
|
|
165
|
+
}
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
function DropdownMenuLabel({
|
|
169
|
+
className,
|
|
170
|
+
inset,
|
|
171
|
+
...props
|
|
172
|
+
}) {
|
|
173
|
+
const { styles } = useDropdownMenuContext();
|
|
174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
175
|
+
DropdownMenuPrimitive.Label,
|
|
176
|
+
{
|
|
177
|
+
"data-slot": "dropdown-menu-label",
|
|
178
|
+
"data-inset": inset,
|
|
179
|
+
className: styles.label({ className }),
|
|
180
|
+
...props
|
|
181
|
+
}
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
function DropdownMenuSeparator({
|
|
185
|
+
className,
|
|
186
|
+
...props
|
|
187
|
+
}) {
|
|
188
|
+
const { styles } = useDropdownMenuContext();
|
|
189
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
190
|
+
DropdownMenuPrimitive.Separator,
|
|
191
|
+
{
|
|
192
|
+
"data-slot": "dropdown-menu-separator",
|
|
193
|
+
className: styles.separator({ className }),
|
|
194
|
+
...props
|
|
195
|
+
}
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
function DropdownMenuShortcut({
|
|
199
|
+
className,
|
|
200
|
+
...props
|
|
201
|
+
}) {
|
|
202
|
+
const { styles } = useDropdownMenuContext();
|
|
203
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
204
|
+
"span",
|
|
205
|
+
{
|
|
206
|
+
"data-slot": "dropdown-menu-shortcut",
|
|
207
|
+
className: styles.shortcut({ className }),
|
|
208
|
+
...props
|
|
209
|
+
}
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
function DropdownMenuSub({ ...props }) {
|
|
213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuPrimitive.Sub, { "data-slot": "dropdown-menu-sub", ...props });
|
|
214
|
+
}
|
|
215
|
+
function DropdownMenuSubTrigger({
|
|
216
|
+
className,
|
|
217
|
+
inset,
|
|
218
|
+
children,
|
|
219
|
+
...props
|
|
220
|
+
}) {
|
|
221
|
+
const { styles } = useDropdownMenuContext();
|
|
222
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
223
|
+
DropdownMenuPrimitive.SubTrigger,
|
|
224
|
+
{
|
|
225
|
+
"data-slot": "dropdown-menu-sub-trigger",
|
|
226
|
+
"data-inset": (0, import_shared_utils.dataAttr)(inset),
|
|
227
|
+
className: styles.subTrigger({ className }),
|
|
228
|
+
...props,
|
|
229
|
+
children: [
|
|
230
|
+
children,
|
|
231
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.ChevronRightIcon, { className: styles.subTriggerIcon() })
|
|
232
|
+
]
|
|
233
|
+
}
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
function DropdownMenuSubContent({
|
|
237
|
+
className,
|
|
238
|
+
...props
|
|
239
|
+
}) {
|
|
240
|
+
const { styles } = useDropdownMenuContext();
|
|
241
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
242
|
+
DropdownMenuPrimitive.SubContent,
|
|
243
|
+
{
|
|
244
|
+
"data-slot": "dropdown-menu-sub-content",
|
|
245
|
+
className: styles.subContent({ className }),
|
|
246
|
+
...props
|
|
247
|
+
}
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
251
|
+
0 && (module.exports = {
|
|
252
|
+
CheckboxItem,
|
|
253
|
+
Content,
|
|
254
|
+
Group,
|
|
255
|
+
Item,
|
|
256
|
+
Label,
|
|
257
|
+
Portal,
|
|
258
|
+
RadioGroup,
|
|
259
|
+
RadioItem,
|
|
260
|
+
Root,
|
|
261
|
+
Separator,
|
|
262
|
+
Shortcut,
|
|
263
|
+
Sub,
|
|
264
|
+
SubContent,
|
|
265
|
+
SubTrigger,
|
|
266
|
+
Trigger
|
|
267
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "./chunk-OEIWSUDF.mjs";
|
|
3
|
+
import {
|
|
4
|
+
DropdownMenuCheckboxItem,
|
|
5
|
+
DropdownMenuContent,
|
|
6
|
+
DropdownMenuGroup,
|
|
7
|
+
DropdownMenuItem,
|
|
8
|
+
DropdownMenuLabel,
|
|
9
|
+
DropdownMenuPortal,
|
|
10
|
+
DropdownMenuRadioGroup,
|
|
11
|
+
DropdownMenuRadioItem,
|
|
12
|
+
DropdownMenuRoot,
|
|
13
|
+
DropdownMenuSeparator,
|
|
14
|
+
DropdownMenuShortcut,
|
|
15
|
+
DropdownMenuSub,
|
|
16
|
+
DropdownMenuSubContent,
|
|
17
|
+
DropdownMenuSubTrigger,
|
|
18
|
+
DropdownMenuTrigger
|
|
19
|
+
} from "./chunk-NF4CISAE.mjs";
|
|
20
|
+
export {
|
|
21
|
+
DropdownMenuCheckboxItem as CheckboxItem,
|
|
22
|
+
DropdownMenuContent as Content,
|
|
23
|
+
DropdownMenuGroup as Group,
|
|
24
|
+
DropdownMenuItem as Item,
|
|
25
|
+
DropdownMenuLabel as Label,
|
|
26
|
+
DropdownMenuPortal as Portal,
|
|
27
|
+
DropdownMenuRadioGroup as RadioGroup,
|
|
28
|
+
DropdownMenuRadioItem as RadioItem,
|
|
29
|
+
DropdownMenuRoot as Root,
|
|
30
|
+
DropdownMenuSeparator as Separator,
|
|
31
|
+
DropdownMenuShortcut as Shortcut,
|
|
32
|
+
DropdownMenuSub as Sub,
|
|
33
|
+
DropdownMenuSubContent as SubContent,
|
|
34
|
+
DropdownMenuSubTrigger as SubTrigger,
|
|
35
|
+
DropdownMenuTrigger as Trigger
|
|
36
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kopexa/dropdown-menu",
|
|
3
|
+
"version": "0.0.0-canary-20250721083908",
|
|
4
|
+
"description": "A dropdown menu",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"dropdown-menu"
|
|
7
|
+
],
|
|
8
|
+
"author": "Kopexa <hello@kopexa.com>",
|
|
9
|
+
"homepage": "https://kopexa.com",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"main": "dist/index.js",
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/kopexa-grc/sight.git",
|
|
22
|
+
"directory": "packages/components/dropdown-menu"
|
|
23
|
+
},
|
|
24
|
+
"bugs": {
|
|
25
|
+
"url": "https://github.com/kopexa-grc/sight/issues"
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"motion": ">=12.23.6",
|
|
29
|
+
"react": ">=19.0.0-rc.0",
|
|
30
|
+
"react-dom": ">=19.0.0-rc.0",
|
|
31
|
+
"@kopexa/theme": "0.0.0-canary-20250721083908",
|
|
32
|
+
"@kopexa/icons": "0.0.0-canary-20250721083908"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@radix-ui/react-dropdown-menu": "^2.1.15",
|
|
36
|
+
"@kopexa/react-utils": "2.0.1",
|
|
37
|
+
"@kopexa/shared-utils": "1.1.1"
|
|
38
|
+
},
|
|
39
|
+
"clean-package": "../../../clean-package.config.json",
|
|
40
|
+
"module": "dist/index.mjs",
|
|
41
|
+
"types": "dist/index.d.ts",
|
|
42
|
+
"exports": {
|
|
43
|
+
".": {
|
|
44
|
+
"types": "./dist/index.d.ts",
|
|
45
|
+
"import": "./dist/index.mjs",
|
|
46
|
+
"require": "./dist/index.js"
|
|
47
|
+
},
|
|
48
|
+
"./package.json": "./package.json"
|
|
49
|
+
},
|
|
50
|
+
"scripts": {
|
|
51
|
+
"build": "tsup src --dts",
|
|
52
|
+
"build:fast": "tsup src",
|
|
53
|
+
"dev": "pnpm build:fast --watch",
|
|
54
|
+
"clean": "rimraf dist .turbo",
|
|
55
|
+
"typecheck": "tsc --noEmit"
|
|
56
|
+
}
|
|
57
|
+
}
|