@mijn-ui/react-command 0.0.2 → 0.0.4
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 +26 -0
- package/dist/index.js +191 -0
- package/dist/metafile-esm.json +1 -0
- package/package.json +7 -7
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { UnstyledProps } from '@mijn-ui/react-utilities/shared';
|
|
4
|
+
import { DialogProps } from '@radix-ui/react-dialog';
|
|
5
|
+
import { Command as Command$1 } from 'cmdk';
|
|
6
|
+
|
|
7
|
+
type CommandProps = React.ComponentPropsWithRef<typeof Command$1> & UnstyledProps;
|
|
8
|
+
declare const Command: ({ unstyled, className, ...props }: CommandProps) => react_jsx_runtime.JSX.Element;
|
|
9
|
+
type CommandDialogProps = DialogProps & UnstyledProps;
|
|
10
|
+
declare const CommandDialog: ({ children, unstyled, ...props }: CommandDialogProps) => react_jsx_runtime.JSX.Element;
|
|
11
|
+
type CommandInputProps = React.ComponentPropsWithRef<typeof Command$1.Input> & UnstyledProps;
|
|
12
|
+
declare const CommandInput: ({ className, unstyled, ...props }: CommandInputProps) => react_jsx_runtime.JSX.Element;
|
|
13
|
+
type CommandListProps = React.ComponentPropsWithRef<typeof Command$1.List> & UnstyledProps;
|
|
14
|
+
declare const CommandList: ({ className, unstyled, ...props }: CommandListProps) => react_jsx_runtime.JSX.Element;
|
|
15
|
+
type CommandEmptyProps = React.ComponentPropsWithRef<typeof Command$1.Empty> & UnstyledProps;
|
|
16
|
+
declare const CommandEmpty: ({ unstyled, className, ...props }: CommandEmptyProps) => react_jsx_runtime.JSX.Element;
|
|
17
|
+
type CommandGroupProps = React.ComponentPropsWithRef<typeof Command$1.Group> & UnstyledProps;
|
|
18
|
+
declare const CommandGroup: ({ className, unstyled, ...props }: CommandGroupProps) => react_jsx_runtime.JSX.Element;
|
|
19
|
+
type CommandSeparatorProps = React.ComponentPropsWithRef<typeof Command$1.Separator> & UnstyledProps;
|
|
20
|
+
declare const CommandSeparator: ({ className, unstyled, ...props }: CommandSeparatorProps) => react_jsx_runtime.JSX.Element;
|
|
21
|
+
type CommandItemProps = React.ComponentPropsWithRef<typeof Command$1.Item> & UnstyledProps;
|
|
22
|
+
declare const CommandItem: ({ className, unstyled, ...props }: CommandItemProps) => react_jsx_runtime.JSX.Element;
|
|
23
|
+
type CommandShortcutProps = React.HTMLAttributes<HTMLSpanElement> & UnstyledProps;
|
|
24
|
+
declare const CommandShortcut: ({ className, unstyled, ...props }: CommandShortcutProps) => react_jsx_runtime.JSX.Element;
|
|
25
|
+
|
|
26
|
+
export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
// src/command.tsx
|
|
4
|
+
import { Dialog, DialogContent } from "@mijn-ui/react-dialog";
|
|
5
|
+
import { UnstyledProvider, useUnstyled } from "@mijn-ui/react-utilities/context";
|
|
6
|
+
import {
|
|
7
|
+
applyUnstyled,
|
|
8
|
+
cn
|
|
9
|
+
} from "@mijn-ui/react-utilities/shared";
|
|
10
|
+
import { Command as CommandPrimitive } from "cmdk";
|
|
11
|
+
import { LuSearch } from "react-icons/lu";
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
var Command = ({ unstyled = false, className, ...props }) => /* @__PURE__ */ jsx(UnstyledProvider, { unstyled, children: /* @__PURE__ */ jsx(
|
|
14
|
+
CommandPrimitive,
|
|
15
|
+
{
|
|
16
|
+
className: cn(
|
|
17
|
+
"border-main-border bg-surface text-surface-text flex size-full flex-col overflow-hidden rounded-md",
|
|
18
|
+
className
|
|
19
|
+
),
|
|
20
|
+
...props
|
|
21
|
+
}
|
|
22
|
+
) });
|
|
23
|
+
var CommandDialog = ({
|
|
24
|
+
children,
|
|
25
|
+
unstyled,
|
|
26
|
+
...props
|
|
27
|
+
}) => {
|
|
28
|
+
const { unstyled: contextUnstyled } = useUnstyled();
|
|
29
|
+
const isUnstyled = unstyled ?? contextUnstyled;
|
|
30
|
+
return /* @__PURE__ */ jsx(Dialog, { ...props, children: /* @__PURE__ */ jsx(
|
|
31
|
+
DialogContent,
|
|
32
|
+
{
|
|
33
|
+
className: applyUnstyled(isUnstyled, " overflow-hidden p-0 shadow-lg"),
|
|
34
|
+
children: /* @__PURE__ */ jsx(
|
|
35
|
+
Command,
|
|
36
|
+
{
|
|
37
|
+
className: applyUnstyled(
|
|
38
|
+
isUnstyled,
|
|
39
|
+
"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-neutral-text [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5"
|
|
40
|
+
),
|
|
41
|
+
children
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
) });
|
|
46
|
+
};
|
|
47
|
+
var CommandInput = ({ className, unstyled, ...props }) => {
|
|
48
|
+
const { unstyled: contextUnstyled } = useUnstyled();
|
|
49
|
+
const isUnstyled = unstyled ?? contextUnstyled;
|
|
50
|
+
return /* @__PURE__ */ jsxs(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
className: applyUnstyled(
|
|
54
|
+
isUnstyled,
|
|
55
|
+
"flex items-center border-b border-main-border px-3"
|
|
56
|
+
),
|
|
57
|
+
"cmdk-input-wrapper": "",
|
|
58
|
+
children: [
|
|
59
|
+
/* @__PURE__ */ jsx(
|
|
60
|
+
LuSearch,
|
|
61
|
+
{
|
|
62
|
+
className: applyUnstyled(
|
|
63
|
+
isUnstyled,
|
|
64
|
+
"mr-2 h-4 w-4 shrink-0 opacity-50"
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
),
|
|
68
|
+
/* @__PURE__ */ jsx(
|
|
69
|
+
CommandPrimitive.Input,
|
|
70
|
+
{
|
|
71
|
+
className: applyUnstyled(
|
|
72
|
+
isUnstyled,
|
|
73
|
+
"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-neutral-text disabled:cursor-not-allowed disabled:opacity-50",
|
|
74
|
+
className
|
|
75
|
+
),
|
|
76
|
+
...props
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
};
|
|
83
|
+
var CommandList = ({ className, unstyled, ...props }) => {
|
|
84
|
+
const { unstyled: contextUnstyled } = useUnstyled();
|
|
85
|
+
const isUnstyled = unstyled ?? contextUnstyled;
|
|
86
|
+
return /* @__PURE__ */ jsx(
|
|
87
|
+
CommandPrimitive.List,
|
|
88
|
+
{
|
|
89
|
+
className: applyUnstyled(
|
|
90
|
+
isUnstyled,
|
|
91
|
+
"max-h-[300px] overflow-y-auto overflow-x-hidden",
|
|
92
|
+
className
|
|
93
|
+
),
|
|
94
|
+
...props
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
};
|
|
98
|
+
var CommandEmpty = ({ unstyled, className, ...props }) => {
|
|
99
|
+
const { unstyled: contextUnstyled } = useUnstyled();
|
|
100
|
+
const isUnstyled = unstyled ?? contextUnstyled;
|
|
101
|
+
return /* @__PURE__ */ jsx(
|
|
102
|
+
CommandPrimitive.Empty,
|
|
103
|
+
{
|
|
104
|
+
className: applyUnstyled(
|
|
105
|
+
isUnstyled,
|
|
106
|
+
"py-6 text-center text-sm",
|
|
107
|
+
className
|
|
108
|
+
),
|
|
109
|
+
...props
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
};
|
|
113
|
+
var CommandGroup = ({ className, unstyled, ...props }) => {
|
|
114
|
+
const { unstyled: contextUnstyled } = useUnstyled();
|
|
115
|
+
const isUnstyled = unstyled ?? contextUnstyled;
|
|
116
|
+
return /* @__PURE__ */ jsx(
|
|
117
|
+
CommandPrimitive.Group,
|
|
118
|
+
{
|
|
119
|
+
className: applyUnstyled(
|
|
120
|
+
isUnstyled,
|
|
121
|
+
"text-text overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-neutral-text",
|
|
122
|
+
className
|
|
123
|
+
),
|
|
124
|
+
...props
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
};
|
|
128
|
+
var CommandSeparator = ({
|
|
129
|
+
className,
|
|
130
|
+
unstyled,
|
|
131
|
+
...props
|
|
132
|
+
}) => {
|
|
133
|
+
const { unstyled: contextUnstyled } = useUnstyled();
|
|
134
|
+
const isUnstyled = unstyled ?? contextUnstyled;
|
|
135
|
+
return /* @__PURE__ */ jsx(
|
|
136
|
+
CommandPrimitive.Separator,
|
|
137
|
+
{
|
|
138
|
+
className: applyUnstyled(
|
|
139
|
+
isUnstyled,
|
|
140
|
+
"-mx-1 h-px bg-main-border",
|
|
141
|
+
className
|
|
142
|
+
),
|
|
143
|
+
...props
|
|
144
|
+
}
|
|
145
|
+
);
|
|
146
|
+
};
|
|
147
|
+
var CommandItem = ({ className, unstyled, ...props }) => {
|
|
148
|
+
const { unstyled: contextUnstyled } = useUnstyled();
|
|
149
|
+
const isUnstyled = unstyled ?? contextUnstyled;
|
|
150
|
+
return /* @__PURE__ */ jsx(
|
|
151
|
+
CommandPrimitive.Item,
|
|
152
|
+
{
|
|
153
|
+
className: applyUnstyled(
|
|
154
|
+
isUnstyled,
|
|
155
|
+
"relative flex cursor-default select-none items-center rounded-md px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-auto data-[selected='true']:bg-accent data-[selected=true]:text-accent-text data-[disabled=true]:opacity-50",
|
|
156
|
+
className
|
|
157
|
+
),
|
|
158
|
+
...props
|
|
159
|
+
}
|
|
160
|
+
);
|
|
161
|
+
};
|
|
162
|
+
var CommandShortcut = ({
|
|
163
|
+
className,
|
|
164
|
+
unstyled,
|
|
165
|
+
...props
|
|
166
|
+
}) => {
|
|
167
|
+
const { unstyled: contextUnstyled } = useUnstyled();
|
|
168
|
+
const isUnstyled = unstyled ?? contextUnstyled;
|
|
169
|
+
return /* @__PURE__ */ jsx(
|
|
170
|
+
"span",
|
|
171
|
+
{
|
|
172
|
+
className: applyUnstyled(
|
|
173
|
+
isUnstyled,
|
|
174
|
+
"ml-auto text-xs tracking-widest text-neutral-text",
|
|
175
|
+
className
|
|
176
|
+
),
|
|
177
|
+
...props
|
|
178
|
+
}
|
|
179
|
+
);
|
|
180
|
+
};
|
|
181
|
+
export {
|
|
182
|
+
Command,
|
|
183
|
+
CommandDialog,
|
|
184
|
+
CommandEmpty,
|
|
185
|
+
CommandGroup,
|
|
186
|
+
CommandInput,
|
|
187
|
+
CommandItem,
|
|
188
|
+
CommandList,
|
|
189
|
+
CommandSeparator,
|
|
190
|
+
CommandShortcut
|
|
191
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"inputs":{"src/command.tsx":{"bytes":8437,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@mijn-ui/react-dialog","kind":"import-statement","external":true},{"path":"@mijn-ui/react-utilities/context","kind":"import-statement","external":true},{"path":"@mijn-ui/react-utilities/shared","kind":"import-statement","external":true},{"path":"@radix-ui/react-dialog","kind":"import-statement","external":true},{"path":"cmdk","kind":"import-statement","external":true},{"path":"react-icons/lu","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":26,"imports":[{"path":"src/command.tsx","kind":"import-statement","original":"./command"}],"format":"esm"}},"outputs":{"dist/index.js":{"imports":[{"path":"@mijn-ui/react-dialog","kind":"import-statement","external":true},{"path":"@mijn-ui/react-utilities/context","kind":"import-statement","external":true},{"path":"@mijn-ui/react-utilities/shared","kind":"import-statement","external":true},{"path":"cmdk","kind":"import-statement","external":true},{"path":"react-icons/lu","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"exports":["Command","CommandDialog","CommandEmpty","CommandGroup","CommandInput","CommandItem","CommandList","CommandSeparator","CommandShortcut"],"entryPoint":"src/index.ts","inputs":{"src/command.tsx":{"bytesInOutput":5303},"src/index.ts":{"bytesInOutput":0}},"bytes":5478}}}
|
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mijn-ui/react-command",
|
|
3
3
|
"author": "Htet Aung Lin<htetaunglin.coder@gmail.com>",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.4",
|
|
5
5
|
"homepage": "https://mijn-ui.vercel.app",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"files": [
|
|
10
|
-
"dist
|
|
10
|
+
"dist"
|
|
11
11
|
],
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
14
|
-
"url": "git+https://github.com/mijn-ui/
|
|
14
|
+
"url": "git+https://github.com/mijn-ui/mijn-ui-react.git",
|
|
15
15
|
"directory": "packages/components/src"
|
|
16
16
|
},
|
|
17
17
|
"bugs": {
|
|
18
|
-
"url": "https://github.com/mijn-ui/
|
|
18
|
+
"url": "https://github.com/mijn-ui/mijn-ui-react/issues"
|
|
19
19
|
},
|
|
20
20
|
"exports": "./dist/index.js",
|
|
21
21
|
"types": "./dist/index.d.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@next/eslint-plugin-next": "^15.0.3",
|
|
24
24
|
"@types/react": "^18.3.12",
|
|
25
25
|
"@types/react-dom": "^18.3.1",
|
|
26
|
-
"eslint-config-custom": "0.0.
|
|
26
|
+
"eslint-config-custom": "0.0.1",
|
|
27
27
|
"tsconfig": "0.0.0"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"react-icons": "^5.3.0",
|
|
33
33
|
"cmdk": "^1.0.4",
|
|
34
34
|
"@radix-ui/react-dialog": "^1.1.2",
|
|
35
|
-
"@mijn-ui/react-
|
|
36
|
-
"@mijn-ui/react-
|
|
35
|
+
"@mijn-ui/react-dialog": "0.0.4",
|
|
36
|
+
"@mijn-ui/react-utilities": "0.0.4"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"react": "19.0.0-rc-b01722d5-20241114",
|