@camped-ui/command 2.1.2 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.ts +42 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -8
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
@@ -1,52 +1,83 @@
|
|
1
|
-
import { type DialogProps } from "@radix-ui/react-dialog";
|
2
|
-
import { Command as CommandPrimitive } from "cmdk";
|
3
1
|
import * as React from "react";
|
2
|
+
import { type DialogProps } from "@radix-ui/react-dialog";
|
4
3
|
declare const Command: React.ForwardRefExoticComponent<Omit<{
|
5
4
|
children?: React.ReactNode;
|
6
|
-
} & React.HTMLAttributes<HTMLDivElement
|
5
|
+
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
6
|
+
ref?: React.Ref<HTMLDivElement>;
|
7
|
+
} & {
|
8
|
+
asChild?: boolean;
|
9
|
+
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
|
7
10
|
label?: string;
|
8
11
|
shouldFilter?: boolean;
|
9
|
-
filter?: (value: string, search: string) => number;
|
12
|
+
filter?: (value: string, search: string, keywords?: string[]) => number;
|
10
13
|
defaultValue?: string;
|
11
14
|
value?: string;
|
12
15
|
onValueChange?: (value: string) => void;
|
13
16
|
loop?: boolean;
|
17
|
+
disablePointerSelection?: boolean;
|
14
18
|
vimBindings?: boolean;
|
15
19
|
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
16
20
|
interface CommandDialogProps extends DialogProps {
|
17
21
|
}
|
18
22
|
declare const CommandDialog: ({ children, ...props }: CommandDialogProps) => import("react/jsx-runtime").JSX.Element;
|
19
|
-
declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
23
|
+
declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof React.InputHTMLAttributes<HTMLInputElement>> & {
|
24
|
+
ref?: React.Ref<HTMLInputElement>;
|
25
|
+
} & {
|
26
|
+
asChild?: boolean;
|
27
|
+
}, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "onChange" | "value" | "type"> & {
|
20
28
|
value?: string;
|
21
29
|
onValueChange?: (search: string) => void;
|
22
30
|
} & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
23
31
|
declare const CommandList: React.ForwardRefExoticComponent<Omit<{
|
24
32
|
children?: React.ReactNode;
|
25
|
-
} & React.
|
33
|
+
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
34
|
+
ref?: React.Ref<HTMLDivElement>;
|
35
|
+
} & {
|
36
|
+
asChild?: boolean;
|
37
|
+
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
|
38
|
+
label?: string;
|
39
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
26
40
|
declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<{
|
27
41
|
children?: React.ReactNode;
|
28
|
-
} & React.
|
42
|
+
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
43
|
+
ref?: React.Ref<HTMLDivElement>;
|
44
|
+
} & {
|
45
|
+
asChild?: boolean;
|
46
|
+
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
29
47
|
declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
|
30
48
|
children?: React.ReactNode;
|
31
|
-
} & Omit<React.HTMLAttributes<HTMLDivElement>, "
|
49
|
+
} & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
50
|
+
ref?: React.Ref<HTMLDivElement>;
|
51
|
+
} & {
|
52
|
+
asChild?: boolean;
|
53
|
+
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild">, "value" | "heading"> & {
|
32
54
|
heading?: React.ReactNode;
|
33
55
|
value?: string;
|
34
56
|
forceMount?: boolean;
|
35
57
|
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
36
|
-
declare const CommandSeparator: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement
|
58
|
+
declare const CommandSeparator: React.ForwardRefExoticComponent<Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
59
|
+
ref?: React.Ref<HTMLDivElement>;
|
60
|
+
} & {
|
61
|
+
asChild?: boolean;
|
62
|
+
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
|
37
63
|
alwaysRender?: boolean;
|
38
64
|
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
39
65
|
declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
|
40
66
|
children?: React.ReactNode;
|
41
|
-
} & Omit<React.HTMLAttributes<HTMLDivElement>, "
|
67
|
+
} & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
68
|
+
ref?: React.Ref<HTMLDivElement>;
|
69
|
+
} & {
|
70
|
+
asChild?: boolean;
|
71
|
+
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild">, "onSelect" | "value" | "disabled"> & {
|
42
72
|
disabled?: boolean;
|
43
73
|
onSelect?: (value: string) => void;
|
44
74
|
value?: string;
|
75
|
+
keywords?: string[];
|
45
76
|
forceMount?: boolean;
|
46
77
|
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
47
78
|
declare const CommandShortcut: {
|
48
79
|
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
|
49
80
|
displayName: string;
|
50
81
|
};
|
51
|
-
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator,
|
82
|
+
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
|
52
83
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAOzD,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;sFAYX,CAAA;AAGF,UAAU,kBAAmB,SAAQ,WAAW;CAAG;AAEnD,QAAA,MAAM,aAAa,2BAA4B,kBAAkB,4CAUhE,CAAA;AAED,QAAA,MAAM,YAAY;;;;;;;0FAehB,CAAA;AAIF,QAAA,MAAM,WAAW;;;;;;;;sFASf,CAAA;AAIF,QAAA,MAAM,YAAY;;;;;;uJAShB,CAAA;AAIF,QAAA,MAAM,YAAY;;;;;;;;;;sFAYhB,CAAA;AAIF,QAAA,MAAM,gBAAgB;;;;;;sFASpB,CAAA;AAGF,QAAA,MAAM,WAAW;;;;;;;;;;;;sFAYf,CAAA;AAIF,QAAA,MAAM,eAAe;8BAGlB,MAAM,cAAc,CAAC,eAAe,CAAC;;CAUvC,CAAA;AAGD,OAAO,EACL,OAAO,EACP,aAAa,EACb,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,eAAe,EACf,gBAAgB,GACjB,CAAA"}
|
package/dist/index.js
CHANGED
@@ -35,14 +35,13 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
35
35
|
return t;
|
36
36
|
};
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
38
|
-
exports.
|
38
|
+
exports.CommandSeparator = exports.CommandShortcut = exports.CommandItem = exports.CommandGroup = exports.CommandEmpty = exports.CommandList = exports.CommandInput = exports.CommandDialog = exports.Command = void 0;
|
39
39
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
40
|
+
const React = __importStar(require("react"));
|
41
|
+
const react_icons_1 = require("@radix-ui/react-icons");
|
42
|
+
const cmdk_1 = require("cmdk");
|
40
43
|
const dialog_1 = require("@camped-ui/dialog");
|
41
44
|
const lib_1 = require("@camped-ui/lib");
|
42
|
-
const cmdk_1 = require("cmdk");
|
43
|
-
Object.defineProperty(exports, "CommandPrimitive", { enumerable: true, get: function () { return cmdk_1.Command; } });
|
44
|
-
const lucide_react_1 = require("lucide-react");
|
45
|
-
const React = __importStar(require("react"));
|
46
45
|
const Command = React.forwardRef((_a, ref) => {
|
47
46
|
var { className } = _a, props = __rest(_a, ["className"]);
|
48
47
|
return ((0, jsx_runtime_1.jsx)(cmdk_1.Command, Object.assign({ ref: ref, className: (0, lib_1.cn)("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground", className) }, props)));
|
@@ -51,12 +50,12 @@ exports.Command = Command;
|
|
51
50
|
Command.displayName = cmdk_1.Command.displayName;
|
52
51
|
const CommandDialog = (_a) => {
|
53
52
|
var { children } = _a, props = __rest(_a, ["children"]);
|
54
|
-
return ((0, jsx_runtime_1.jsx)(dialog_1.Dialog, Object.assign({}, props, { children: (0, jsx_runtime_1.jsx)(dialog_1.DialogContent, { className: "overflow-hidden p-0
|
53
|
+
return ((0, jsx_runtime_1.jsx)(dialog_1.Dialog, Object.assign({}, props, { children: (0, jsx_runtime_1.jsx)(dialog_1.DialogContent, { className: "overflow-hidden p-0", children: (0, jsx_runtime_1.jsx)(Command, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[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", children: children }) }) })));
|
55
54
|
};
|
56
55
|
exports.CommandDialog = CommandDialog;
|
57
56
|
const CommandInput = React.forwardRef((_a, ref) => {
|
58
57
|
var { className } = _a, props = __rest(_a, ["className"]);
|
59
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [(0, jsx_runtime_1.jsx)(
|
58
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [(0, jsx_runtime_1.jsx)(react_icons_1.MagnifyingGlassIcon, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }), (0, jsx_runtime_1.jsx)(cmdk_1.Command.Input, Object.assign({ ref: ref, className: (0, lib_1.cn)("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50", className) }, props))] }));
|
60
59
|
});
|
61
60
|
exports.CommandInput = CommandInput;
|
62
61
|
CommandInput.displayName = cmdk_1.Command.Input.displayName;
|
@@ -83,7 +82,7 @@ exports.CommandSeparator = CommandSeparator;
|
|
83
82
|
CommandSeparator.displayName = cmdk_1.Command.Separator.displayName;
|
84
83
|
const CommandItem = React.forwardRef((_a, ref) => {
|
85
84
|
var { className } = _a, props = __rest(_a, ["className"]);
|
86
|
-
return ((0, jsx_runtime_1.jsx)(cmdk_1.Command.Item, Object.assign({ ref: ref, className: (0, lib_1.cn)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none
|
85
|
+
return ((0, jsx_runtime_1.jsx)(cmdk_1.Command.Item, Object.assign({ ref: ref, className: (0, lib_1.cn)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50", className) }, props)));
|
87
86
|
});
|
88
87
|
exports.CommandItem = CommandItem;
|
89
88
|
CommandItem.displayName = cmdk_1.Command.Item.displayName;
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,YAAY,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEZ,6CAA8B;AAE9B,uDAA2D;AAC3D,+BAAkD;AAElD,8CAA0D;AAC1D,wCAAoC;AAEpC,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAG9B,CAAC,EAAuB,EAAE,GAAG,EAAE,EAAE;QAAhC,EAAE,SAAS,OAAY,EAAP,KAAK,cAArB,aAAuB,CAAF;IAAY,OAAA,CAClC,uBAAC,cAAgB,kBACf,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,QAAE,EACX,2FAA2F,EAC3F,SAAS,CACV,IACG,KAAK,EACT,CACH,CAAA;CAAA,CAAC,CAAA;AA2HA,0BAAO;AA1HT,OAAO,CAAC,WAAW,GAAG,cAAgB,CAAC,WAA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P,KAAK,cAArB,aAAuB,CAAF;IAAY,OAAA,CAClC,uBAAC,cAAgB,CAAC,IAAI,kBACpB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,QAAE,EACX,uPAAuP,EACvP,SAAS,CACV,IACG,KAAK,EACT,CACH,CAAA;CAAA,CAAC,CAAA;AA2BA,kCAAW;AAzBb,WAAW,CAAC,WAAW,GAAG,cAAgB,CAAC,IAAI,CAAC,WAAW,CAAA;AAE3D,MAAM,eAAe,GAAG,CAAC,EAGe,EAAE,EAAE;QAHnB,EACvB,SAAS,OAE6B,EADnC,KAAK,cAFe,aAGxB,CADS;IAER,OAAO,CACL,+CACE,SAAS,EAAE,IAAA,QAAE,EACX,uDAAuD,EACvD,SAAS,CACV,IACG,KAAK,EACT,CACH,CAAA;AACH,CAAC,CAAA;AAWC,0CAAe;AAVjB,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAA"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@camped-ui/command",
|
3
|
-
"version": "
|
3
|
+
"version": "3.0.1",
|
4
4
|
"main": "dist/index.js",
|
5
5
|
"scripts": {
|
6
6
|
"publish-package": "npm publish --access public",
|
@@ -9,7 +9,7 @@
|
|
9
9
|
},
|
10
10
|
"dependencies": {
|
11
11
|
"@radix-ui/react-dialog": "^1.0.2",
|
12
|
-
"cmdk": "
|
12
|
+
"cmdk": "1.0.0",
|
13
13
|
"@camped-ui/dialog": "2.0.2"
|
14
14
|
},
|
15
15
|
"peerDependencies": {
|