@mijn-ui/react-dropdown-menu 0.0.11 → 0.0.13

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.d.ts CHANGED
@@ -1,14 +1,15 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
- import { UnstyledProps } from '@mijn-ui/react-core';
3
+ import { UnstyledProps, UnstyledComponentWithSlots, DropdownMenuSlots } from '@mijn-ui/react-theme';
4
4
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
5
5
 
6
6
  declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
7
7
  declare const DropdownMenuPortal: React.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
8
8
  declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
9
9
  declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
10
- type DropdownMenuProps = DropdownMenuPrimitive.DropdownMenuProps & UnstyledProps;
11
- declare const DropdownMenu: ({ unstyled, ...props }: DropdownMenuProps) => react_jsx_runtime.JSX.Element;
10
+ type DropdownMenuBaseProps = UnstyledComponentWithSlots<DropdownMenuSlots>;
11
+ type DropdownMenuProps = DropdownMenuPrimitive.DropdownMenuProps & DropdownMenuBaseProps;
12
+ declare const DropdownMenu: ({ classNames, unstyled, ...props }: DropdownMenuProps) => react_jsx_runtime.JSX.Element;
12
13
  type DropdownTriggerProps = React.ComponentPropsWithRef<typeof DropdownMenuPrimitive.Trigger> & UnstyledProps;
13
14
  declare const DropdownMenuTrigger: ({ unstyled, className, ...props }: DropdownTriggerProps) => react_jsx_runtime.JSX.Element;
14
15
  type DropdownMenuSubTriggerProps = React.ComponentPropsWithRef<typeof DropdownMenuPrimitive.SubTrigger> & UnstyledProps & {
@@ -38,4 +39,4 @@ declare const DropdownMenuShortcut: {
38
39
  displayName: string;
39
40
  };
40
41
 
41
- export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
42
+ export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, type DropdownMenuProps, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
package/dist/index.js CHANGED
@@ -1,11 +1,14 @@
1
1
  "use client"
2
2
 
3
3
  // src/dropdown-menu.tsx
4
+ import { useTVUnstyled } from "@mijn-ui/react-hooks";
5
+ import {
6
+ cn,
7
+ dropdownMenuStyles
8
+ } from "@mijn-ui/react-theme";
4
9
  import { createContext } from "@mijn-ui/react-utilities";
5
- import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
6
10
  import { CheckIcon, ChevronRightIcon, CircleIcon } from "@mijn-ui/shared-icons";
7
- import { dropdownMenuStyles } from "@mijn-ui/react-theme";
8
- import { useTVUnstyled } from "@mijn-ui/react-hooks";
11
+ import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
9
12
  import { jsx, jsxs } from "react/jsx-runtime";
10
13
  var DropdownMenuGroup = DropdownMenuPrimitive.Group;
11
14
  var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
@@ -18,22 +21,29 @@ var [DropdownProvider, useDropdownContext] = createContext({
18
21
  });
19
22
  var useDropdownStyles = (unstyledOverride) => {
20
23
  const context = useDropdownContext();
21
- return useTVUnstyled(context, unstyledOverride);
24
+ const unstyledSlots = useTVUnstyled(context, unstyledOverride);
25
+ return { ...unstyledSlots, classNames: context.classNames };
22
26
  };
23
- var DropdownMenu = ({ unstyled = false, ...props }) => {
27
+ var DropdownMenu = ({
28
+ classNames,
29
+ unstyled = false,
30
+ ...props
31
+ }) => {
24
32
  const styles = dropdownMenuStyles();
25
- return /* @__PURE__ */ jsx(DropdownProvider, { value: { unstyled, styles }, children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.Root, { ...props }) });
33
+ return /* @__PURE__ */ jsx(DropdownProvider, { value: { unstyled, styles, classNames }, children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.Root, { ...props }) });
26
34
  };
27
35
  var DropdownMenuTrigger = ({
28
36
  unstyled,
29
37
  className,
30
38
  ...props
31
39
  }) => {
32
- const { trigger } = useDropdownStyles(unstyled);
40
+ const { trigger, classNames } = useDropdownStyles(unstyled);
33
41
  return /* @__PURE__ */ jsx(
34
42
  DropdownMenuPrimitive.Trigger,
35
43
  {
36
- className: trigger({ className }),
44
+ className: trigger({
45
+ className: cn(classNames?.trigger, className)
46
+ }),
37
47
  ...props
38
48
  }
39
49
  );
@@ -45,15 +55,23 @@ var DropdownMenuSubTrigger = ({
45
55
  children,
46
56
  ...props
47
57
  }) => {
48
- const { subTrigger } = useDropdownStyles(unstyled);
58
+ const { subTrigger, subTriggerIcon, classNames } = useDropdownStyles(unstyled);
49
59
  return /* @__PURE__ */ jsxs(
50
60
  DropdownMenuPrimitive.SubTrigger,
51
61
  {
52
- className: subTrigger({ className, inset }),
62
+ className: subTrigger({
63
+ className: cn(classNames?.subTrigger, className),
64
+ inset
65
+ }),
53
66
  ...props,
54
67
  children: [
55
68
  children,
56
- /* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto" })
69
+ /* @__PURE__ */ jsx(
70
+ ChevronRightIcon,
71
+ {
72
+ className: subTriggerIcon({ className: classNames?.subTriggerIcon })
73
+ }
74
+ )
57
75
  ]
58
76
  }
59
77
  );
@@ -63,11 +81,13 @@ var DropdownMenuSubContent = ({
63
81
  className,
64
82
  ...props
65
83
  }) => {
66
- const { subContent } = useDropdownStyles(unstyled);
84
+ const { subContent, classNames } = useDropdownStyles(unstyled);
67
85
  return /* @__PURE__ */ jsx(
68
86
  DropdownMenuPrimitive.SubContent,
69
87
  {
70
- className: subContent({ className }),
88
+ className: subContent({
89
+ className: cn(classNames?.subContent, className)
90
+ }),
71
91
  ...props
72
92
  }
73
93
  );
@@ -78,12 +98,14 @@ var DropdownMenuContent = ({
78
98
  sideOffset = 4,
79
99
  ...props
80
100
  }) => {
81
- const { content } = useDropdownStyles(unstyled);
101
+ const { content, classNames } = useDropdownStyles(unstyled);
82
102
  return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
83
103
  DropdownMenuPrimitive.Content,
84
104
  {
85
105
  sideOffset,
86
- className: content({ className }),
106
+ className: content({
107
+ className: cn(classNames?.content, className)
108
+ }),
87
109
  ...props
88
110
  }
89
111
  ) });
@@ -94,11 +116,14 @@ var DropdownMenuItem = ({
94
116
  inset,
95
117
  ...props
96
118
  }) => {
97
- const { item } = useDropdownStyles(unstyled);
119
+ const { item, classNames } = useDropdownStyles(unstyled);
98
120
  return /* @__PURE__ */ jsx(
99
121
  DropdownMenuPrimitive.Item,
100
122
  {
101
- className: item({ className, inset }),
123
+ className: item({
124
+ className: cn(classNames?.item, className),
125
+ inset
126
+ }),
102
127
  ...props
103
128
  }
104
129
  );
@@ -110,15 +135,37 @@ var DropdownMenuCheckboxItem = ({
110
135
  checked,
111
136
  ...props
112
137
  }) => {
113
- const { checkboxItem, checkboxItemIconWrapper, checkboxItemIcon } = useDropdownStyles(unstyled);
138
+ const {
139
+ checkboxItem,
140
+ checkboxItemIconWrapper,
141
+ checkboxItemIcon,
142
+ classNames
143
+ } = useDropdownStyles(unstyled);
114
144
  return /* @__PURE__ */ jsxs(
115
145
  DropdownMenuPrimitive.CheckboxItem,
116
146
  {
117
- className: checkboxItem({ className }),
147
+ className: checkboxItem({
148
+ className: cn(classNames?.checkboxItem, className)
149
+ }),
118
150
  checked,
119
151
  ...props,
120
152
  children: [
121
- /* @__PURE__ */ jsx("span", { className: checkboxItemIconWrapper(), children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: checkboxItemIcon() }) }) }),
153
+ /* @__PURE__ */ jsx(
154
+ "span",
155
+ {
156
+ className: checkboxItemIconWrapper({
157
+ className: classNames?.checkboxItemIconWrapper
158
+ }),
159
+ children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(
160
+ CheckIcon,
161
+ {
162
+ className: checkboxItemIcon({
163
+ className: classNames?.checkboxItemIcon
164
+ })
165
+ }
166
+ ) })
167
+ }
168
+ ),
122
169
  children
123
170
  ]
124
171
  }
@@ -130,14 +177,31 @@ var DropdownMenuRadioItem = ({
130
177
  children,
131
178
  ...props
132
179
  }) => {
133
- const { radioItem, radioItemIconWrapper, radioItemIcon } = useDropdownStyles(unstyled);
180
+ const { radioItem, radioItemIconWrapper, radioItemIcon, classNames } = useDropdownStyles(unstyled);
134
181
  return /* @__PURE__ */ jsxs(
135
182
  DropdownMenuPrimitive.RadioItem,
136
183
  {
137
- className: radioItem({ className }),
184
+ className: radioItem({
185
+ className: cn(classNames?.radioItem, className)
186
+ }),
138
187
  ...props,
139
188
  children: [
140
- /* @__PURE__ */ jsx("span", { className: radioItemIconWrapper(), children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CircleIcon, { className: radioItemIcon() }) }) }),
189
+ /* @__PURE__ */ jsx(
190
+ "span",
191
+ {
192
+ className: radioItemIconWrapper({
193
+ className: classNames?.radioItemIconWrapper
194
+ }),
195
+ children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(
196
+ CircleIcon,
197
+ {
198
+ className: radioItemIcon({
199
+ className: classNames?.radioItemIcon
200
+ })
201
+ }
202
+ ) })
203
+ }
204
+ ),
141
205
  children
142
206
  ]
143
207
  }
@@ -149,11 +213,14 @@ var DropdownMenuLabel = ({
149
213
  inset,
150
214
  ...props
151
215
  }) => {
152
- const { label } = useDropdownStyles(unstyled);
216
+ const { label, classNames } = useDropdownStyles(unstyled);
153
217
  return /* @__PURE__ */ jsx(
154
218
  DropdownMenuPrimitive.Label,
155
219
  {
156
- className: label({ className, inset }),
220
+ className: label({
221
+ className: cn(classNames?.label, className),
222
+ inset
223
+ }),
157
224
  ...props
158
225
  }
159
226
  );
@@ -163,11 +230,13 @@ var DropdownMenuSeparator = ({
163
230
  unstyled,
164
231
  ...props
165
232
  }) => {
166
- const { separator } = useDropdownStyles(unstyled);
233
+ const { separator, classNames } = useDropdownStyles(unstyled);
167
234
  return /* @__PURE__ */ jsx(
168
235
  DropdownMenuPrimitive.Separator,
169
236
  {
170
- className: separator({ className }),
237
+ className: separator({
238
+ className: cn(classNames?.separator, className)
239
+ }),
171
240
  ...props
172
241
  }
173
242
  );
@@ -177,8 +246,16 @@ var DropdownMenuShortcut = ({
177
246
  unstyled,
178
247
  ...props
179
248
  }) => {
180
- const { shortcut } = useDropdownStyles(unstyled);
181
- return /* @__PURE__ */ jsx("span", { className: shortcut({ className }), ...props });
249
+ const { shortcut, classNames } = useDropdownStyles(unstyled);
250
+ return /* @__PURE__ */ jsx(
251
+ "span",
252
+ {
253
+ className: shortcut({
254
+ className: cn(classNames?.shortcut, className)
255
+ }),
256
+ ...props
257
+ }
258
+ );
182
259
  };
183
260
  DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
184
261
  export {
@@ -1 +1 @@
1
- {"inputs":{"src/dropdown-menu.tsx":{"bytes":9876,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@mijn-ui/react-utilities","kind":"import-statement","external":true},{"path":"@mijn-ui/react-core","kind":"import-statement","external":true},{"path":"@radix-ui/react-dropdown-menu","kind":"import-statement","external":true},{"path":"@mijn-ui/shared-icons","kind":"import-statement","external":true},{"path":"@mijn-ui/react-theme","kind":"import-statement","external":true},{"path":"@mijn-ui/react-hooks","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-utilities","kind":"import-statement","external":true},{"path":"@radix-ui/react-dropdown-menu","kind":"import-statement","external":true},{"path":"@mijn-ui/shared-icons","kind":"import-statement","external":true},{"path":"@mijn-ui/react-theme","kind":"import-statement","external":true},{"path":"@mijn-ui/react-hooks","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"],"entryPoint":"src/index.ts","inputs":{"src/dropdown-menu.tsx":{"bytesInOutput":4862},"src/index.ts":{"bytesInOutput":0}},"bytes":5243}}}
1
+ {"inputs":{"src/dropdown-menu.tsx":{"bytes":11245,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@mijn-ui/react-hooks","kind":"import-statement","external":true},{"path":"@mijn-ui/react-theme","kind":"import-statement","external":true},{"path":"@mijn-ui/react-utilities","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":"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-hooks","kind":"import-statement","external":true},{"path":"@mijn-ui/react-theme","kind":"import-statement","external":true},{"path":"@mijn-ui/react-utilities","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":"react/jsx-runtime","kind":"import-statement","external":true}],"exports":["DropdownMenu","DropdownMenuCheckboxItem","DropdownMenuContent","DropdownMenuGroup","DropdownMenuItem","DropdownMenuLabel","DropdownMenuPortal","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuSeparator","DropdownMenuShortcut","DropdownMenuSub","DropdownMenuSubContent","DropdownMenuSubTrigger","DropdownMenuTrigger"],"entryPoint":"src/index.ts","inputs":{"src/dropdown-menu.tsx":{"bytesInOutput":6367},"src/index.ts":{"bytesInOutput":0}},"bytes":6748}}}
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.0.11",
4
+ "version": "0.0.13",
5
5
  "homepage": "https://mijn-ui.vercel.app",
6
6
  "license": "MIT",
7
7
  "type": "module",
@@ -22,25 +22,28 @@
22
22
  "devDependencies": {
23
23
  "react": "19.0.0",
24
24
  "react-dom": "19.0.0",
25
+ "react-icons": "^5.3.0",
25
26
  "@next/eslint-plugin-next": "^15.0.3",
26
27
  "@types/react": "^19.0.0",
27
28
  "@types/react-dom": "^19.0.0",
28
- "@mijn-ui/react-core": "0.0.3",
29
+ "@mijn-ui/react-core": "0.0.4",
30
+ "@mijn-ui/react-theme": "0.0.9",
31
+ "@mijn-ui/react-button": "0.0.13",
29
32
  "eslint-config-custom": "0.0.1",
30
33
  "tsconfig": "0.0.0",
31
34
  "tsup-config": "0.0.0"
32
35
  },
33
36
  "dependencies": {
34
37
  "@radix-ui/react-dropdown-menu": "^2.1.3",
35
- "@mijn-ui/shared-icons": "0.0.3",
36
- "@mijn-ui/react-utilities": "0.0.8",
37
- "@mijn-ui/react-hooks": "0.0.10"
38
+ "@mijn-ui/shared-icons": "0.0.4",
39
+ "@mijn-ui/react-utilities": "0.0.9",
40
+ "@mijn-ui/react-hooks": "0.0.11"
38
41
  },
39
42
  "peerDependencies": {
40
43
  "react": "^19.0",
41
44
  "react-dom": "^19.0",
42
- "@mijn-ui/react-theme": "^0.0.6",
43
- "@mijn-ui/react-core": "^0.0.3"
45
+ "@mijn-ui/react-theme": "^0.0.9",
46
+ "@mijn-ui/react-core": "^0.0.4"
44
47
  },
45
48
  "publishConfig": {
46
49
  "access": "public"