@mijn-ui/react-dropdown-menu 0.4.1 → 0.4.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/index.js +22 -12
- package/dist/metafile-esm.json +1 -1
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import { tv } from "tailwind-variants";
|
|
|
12
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
var itemFocusClasses = ["focus:bg-bg-secondary"];
|
|
14
14
|
var commonContentClasses = [
|
|
15
|
-
"z-50 min-w-
|
|
15
|
+
"z-50 min-w-32 overflow-hidden rounded-md border border-outline-default bg-bg-default-alt text-fg-default shadow-(--mijn-shadow-lg)"
|
|
16
16
|
];
|
|
17
17
|
var commonItemClasses = [
|
|
18
18
|
"relative flex cursor-default select-none items-center py-1.5 pl-8 pr-2 text-sm outline-none transition-colors"
|
|
@@ -35,26 +35,26 @@ var dropdownMenuStyles = tv({
|
|
|
35
35
|
"data-[state=closed]:zoom-out-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0",
|
|
36
36
|
"data-[side=bottom]:slide-in-from-bottom-6 data-[side=left]:slide-in-from-left-6 data-[side=right]:slide-in-from-right-6 data-[side=top]:slide-in-from-top-6",
|
|
37
37
|
...commonContentClasses,
|
|
38
|
-
"
|
|
38
|
+
"duration-300"
|
|
39
39
|
],
|
|
40
40
|
item: [
|
|
41
41
|
...itemFocusClasses,
|
|
42
|
-
"data-
|
|
43
|
-
"data-
|
|
42
|
+
"data-disabled:pointer-events-none",
|
|
43
|
+
"data-disabled:opacity-50",
|
|
44
44
|
"relative flex h-9 cursor-default select-none items-center gap-2 px-2 text-sm outline-none transition-colors [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0"
|
|
45
45
|
],
|
|
46
46
|
checkboxItem: [
|
|
47
47
|
...itemFocusClasses,
|
|
48
|
-
"data-
|
|
49
|
-
"data-
|
|
48
|
+
"data-disabled:pointer-events-none",
|
|
49
|
+
"data-disabled:opacity-50",
|
|
50
50
|
...commonItemClasses
|
|
51
51
|
],
|
|
52
52
|
checkboxItemIconWrapper: commonIconWrapperClasses,
|
|
53
53
|
checkboxItemIcon: "size-4",
|
|
54
54
|
radioItem: [
|
|
55
55
|
...itemFocusClasses,
|
|
56
|
-
"data-
|
|
57
|
-
"data-
|
|
56
|
+
"data-disabled:pointer-events-none",
|
|
57
|
+
"data-disabled:opacity-50",
|
|
58
58
|
...commonItemClasses
|
|
59
59
|
],
|
|
60
60
|
radioItemIconWrapper: commonIconWrapperClasses,
|
|
@@ -93,7 +93,7 @@ var DropdownMenu = ({
|
|
|
93
93
|
...props
|
|
94
94
|
}) => {
|
|
95
95
|
const styles = dropdownMenuStyles();
|
|
96
|
-
return /* @__PURE__ */ jsx(DropdownProvider, { value: { unstyled, styles, classNames }, children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.Root, { ...props }) });
|
|
96
|
+
return /* @__PURE__ */ jsx(DropdownProvider, { value: { unstyled, styles, classNames }, children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props }) });
|
|
97
97
|
};
|
|
98
98
|
var DropdownMenuTrigger = ({
|
|
99
99
|
unstyled,
|
|
@@ -104,6 +104,7 @@ var DropdownMenuTrigger = ({
|
|
|
104
104
|
return /* @__PURE__ */ jsx(
|
|
105
105
|
DropdownMenuPrimitive.Trigger,
|
|
106
106
|
{
|
|
107
|
+
"data-slot": "dropdown-menu-trigger",
|
|
107
108
|
className: trigger({
|
|
108
109
|
className: cn(classNames?.trigger, className)
|
|
109
110
|
}),
|
|
@@ -122,6 +123,7 @@ var DropdownMenuSubTrigger = ({
|
|
|
122
123
|
return /* @__PURE__ */ jsxs(
|
|
123
124
|
DropdownMenuPrimitive.SubTrigger,
|
|
124
125
|
{
|
|
126
|
+
"data-slot": "dropdown-menu-sub-trigger",
|
|
125
127
|
className: subTrigger({
|
|
126
128
|
className: cn(classNames?.subTrigger, className),
|
|
127
129
|
inset
|
|
@@ -148,6 +150,7 @@ var DropdownMenuSubContent = ({
|
|
|
148
150
|
return /* @__PURE__ */ jsx(
|
|
149
151
|
DropdownMenuPrimitive.SubContent,
|
|
150
152
|
{
|
|
153
|
+
"data-slot": "dropdown-menu-sub-content",
|
|
151
154
|
className: subContent({
|
|
152
155
|
className: cn(classNames?.subContent, className)
|
|
153
156
|
}),
|
|
@@ -162,9 +165,10 @@ var DropdownMenuContent = ({
|
|
|
162
165
|
...props
|
|
163
166
|
}) => {
|
|
164
167
|
const { content, classNames } = useDropdownStyles(unstyled);
|
|
165
|
-
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
168
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { "data-slot": "dropdown-menu-portal", children: /* @__PURE__ */ jsx(
|
|
166
169
|
DropdownMenuPrimitive.Content,
|
|
167
170
|
{
|
|
171
|
+
"data-slot": "dropdown-menu-content",
|
|
168
172
|
sideOffset,
|
|
169
173
|
className: content({
|
|
170
174
|
className: cn(classNames?.content, className)
|
|
@@ -183,6 +187,7 @@ var DropdownMenuItem = ({
|
|
|
183
187
|
return /* @__PURE__ */ jsx(
|
|
184
188
|
DropdownMenuPrimitive.Item,
|
|
185
189
|
{
|
|
190
|
+
"data-slot": "dropdown-menu-item",
|
|
186
191
|
className: item({
|
|
187
192
|
className: cn(classNames?.item, className),
|
|
188
193
|
inset
|
|
@@ -207,6 +212,7 @@ var DropdownMenuCheckboxItem = ({
|
|
|
207
212
|
return /* @__PURE__ */ jsxs(
|
|
208
213
|
DropdownMenuPrimitive.CheckboxItem,
|
|
209
214
|
{
|
|
215
|
+
"data-slot": "dropdown-menu-checkbox-item",
|
|
210
216
|
className: checkboxItem({
|
|
211
217
|
className: cn(classNames?.checkboxItem, className)
|
|
212
218
|
}),
|
|
@@ -219,7 +225,7 @@ var DropdownMenuCheckboxItem = ({
|
|
|
219
225
|
className: checkboxItemIconWrapper({
|
|
220
226
|
className: classNames?.checkboxItemIconWrapper
|
|
221
227
|
}),
|
|
222
|
-
children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(
|
|
228
|
+
children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { "data-slot": "dropdown-menu-item-indicator", children: /* @__PURE__ */ jsx(
|
|
223
229
|
CheckIcon,
|
|
224
230
|
{
|
|
225
231
|
className: checkboxItemIcon({
|
|
@@ -244,6 +250,7 @@ var DropdownMenuRadioItem = ({
|
|
|
244
250
|
return /* @__PURE__ */ jsxs(
|
|
245
251
|
DropdownMenuPrimitive.RadioItem,
|
|
246
252
|
{
|
|
253
|
+
"data-slot": "dropdown-menu-radio-item",
|
|
247
254
|
className: radioItem({
|
|
248
255
|
className: cn(classNames?.radioItem, className)
|
|
249
256
|
}),
|
|
@@ -255,7 +262,7 @@ var DropdownMenuRadioItem = ({
|
|
|
255
262
|
className: radioItemIconWrapper({
|
|
256
263
|
className: classNames?.radioItemIconWrapper
|
|
257
264
|
}),
|
|
258
|
-
children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(
|
|
265
|
+
children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { "data-slot": "dropdown-menu-item-indicator", children: /* @__PURE__ */ jsx(
|
|
259
266
|
CircleIcon,
|
|
260
267
|
{
|
|
261
268
|
className: radioItemIcon({
|
|
@@ -280,6 +287,7 @@ var DropdownMenuLabel = ({
|
|
|
280
287
|
return /* @__PURE__ */ jsx(
|
|
281
288
|
DropdownMenuPrimitive.Label,
|
|
282
289
|
{
|
|
290
|
+
"data-slot": "dropdown-menu-label",
|
|
283
291
|
className: label({
|
|
284
292
|
className: cn(classNames?.label, className),
|
|
285
293
|
inset
|
|
@@ -297,6 +305,7 @@ var DropdownMenuSeparator = ({
|
|
|
297
305
|
return /* @__PURE__ */ jsx(
|
|
298
306
|
DropdownMenuPrimitive.Separator,
|
|
299
307
|
{
|
|
308
|
+
"data-slot": "dropdown-menu-separator",
|
|
300
309
|
className: separator({
|
|
301
310
|
className: cn(classNames?.separator, className)
|
|
302
311
|
}),
|
|
@@ -313,6 +322,7 @@ var DropdownMenuShortcut = ({
|
|
|
313
322
|
return /* @__PURE__ */ jsx(
|
|
314
323
|
"span",
|
|
315
324
|
{
|
|
325
|
+
"data-slot": "dropdown-menu-shortcut",
|
|
316
326
|
className: shortcut({
|
|
317
327
|
className: cn(classNames?.shortcut, className)
|
|
318
328
|
}),
|
package/dist/metafile-esm.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/dropdown-menu.tsx":{"bytes":
|
|
1
|
+
{"inputs":{"src/dropdown-menu.tsx":{"bytes":14934,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@mijn-ui/react-core","kind":"import-statement","external":true},{"path":"@mijn-ui/shared-icons","kind":"import-statement","external":true},{"path":"@radix-ui/react-dropdown-menu","kind":"import-statement","external":true},{"path":"tailwind-variants","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":32,"imports":[{"path":"src/dropdown-menu.tsx","kind":"import-statement","original":"./dropdown-menu"}],"format":"esm"}},"outputs":{"dist/index.js":{"imports":[{"path":"@mijn-ui/react-core","kind":"import-statement","external":true},{"path":"@mijn-ui/shared-icons","kind":"import-statement","external":true},{"path":"@radix-ui/react-dropdown-menu","kind":"import-statement","external":true},{"path":"tailwind-variants","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"exports":["DropdownMenu","DropdownMenuCheckboxItem","DropdownMenuContent","DropdownMenuGroup","DropdownMenuItem","DropdownMenuLabel","DropdownMenuPortal","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuSeparator","DropdownMenuShortcut","DropdownMenuSub","DropdownMenuSubContent","DropdownMenuSubTrigger","DropdownMenuTrigger","dropdownMenuStyles","useDropdownStyles"],"entryPoint":"src/index.ts","inputs":{"src/dropdown-menu.tsx":{"bytesInOutput":9625},"src/index.ts":{"bytesInOutput":0}},"bytes":10064}}}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mijn-ui/react-dropdown-menu",
|
|
3
3
|
"author": "Htet Aung Lin<htetaunglin.coder@gmail.com>",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.3",
|
|
5
5
|
"homepage": "https://mijn-ui.vercel.app",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
@@ -24,20 +24,20 @@
|
|
|
24
24
|
"@types/react": "^19.0.0",
|
|
25
25
|
"@types/react-dom": "^19.0.0",
|
|
26
26
|
"lucide-react": "^0.479.0",
|
|
27
|
-
"react": "19.0.
|
|
28
|
-
"react-dom": "19.0.
|
|
29
|
-
"@mijn-ui/react-button": "0.
|
|
30
|
-
"@mijn-ui/react-core": "0.
|
|
27
|
+
"react": "19.0.1",
|
|
28
|
+
"react-dom": "19.0.1",
|
|
29
|
+
"@mijn-ui/react-button": "0.7.0",
|
|
30
|
+
"@mijn-ui/react-core": "0.6.0",
|
|
31
31
|
"eslint-config-custom": "0.0.1",
|
|
32
32
|
"tsconfig": "0.0.0",
|
|
33
33
|
"tsup-config": "0.0.0"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@radix-ui/react-dropdown-menu": "^2.1
|
|
37
|
-
"@mijn-ui/shared-icons": "0.
|
|
36
|
+
"@radix-ui/react-dropdown-menu": "^2.2.1",
|
|
37
|
+
"@mijn-ui/shared-icons": "0.2.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@mijn-ui/react-core": "^0.
|
|
40
|
+
"@mijn-ui/react-core": "^0.6.0",
|
|
41
41
|
"tailwind-merge": "^3.0.0",
|
|
42
42
|
"tailwind-variants": "^3.0.0",
|
|
43
43
|
"react": "^19.0",
|