@camped-ui/command 2.0.2 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -1 +1,13 @@
1
- # @camped-ui/collapsible
1
+ # command
2
+
3
+ Command component is a fast, composable, and unstyled command menu designed for React. It provides a versatile and efficient way to create command menus in React applications. The component's flexibility allows developers to compose and customize the menu to fit the specific needs of their application. Whether creating context menus, dropdowns, or any scenario requiring a command-based interface, the Command component streamlines the process with speed and simplicity.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ yarn add @camped-ui/command
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ View docs [here](https://ui.camped.academy/docs/components/command).
package/dist/index.d.ts CHANGED
@@ -1,14 +1,17 @@
1
- import * as React from "react";
2
1
  import { type DialogProps } from "@radix-ui/react-dialog";
2
+ import { Command as CommandPrimitive } from "cmdk";
3
+ import * as React from "react";
3
4
  declare const Command: React.ForwardRefExoticComponent<Omit<{
4
5
  children?: React.ReactNode;
5
6
  } & React.HTMLAttributes<HTMLDivElement> & {
6
7
  label?: string;
7
8
  shouldFilter?: boolean;
8
9
  filter?: (value: string, search: string) => number;
10
+ defaultValue?: string;
9
11
  value?: string;
10
12
  onValueChange?: (value: string) => void;
11
13
  loop?: boolean;
14
+ vimBindings?: boolean;
12
15
  } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
16
  interface CommandDialogProps extends DialogProps {
14
17
  }
@@ -28,6 +31,7 @@ declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
28
31
  } & Omit<React.HTMLAttributes<HTMLDivElement>, "value" | "heading"> & {
29
32
  heading?: React.ReactNode;
30
33
  value?: string;
34
+ forceMount?: boolean;
31
35
  } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
32
36
  declare const CommandSeparator: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement> & {
33
37
  alwaysRender?: boolean;
@@ -38,10 +42,11 @@ declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
38
42
  disabled?: boolean;
39
43
  onSelect?: (value: string) => void;
40
44
  value?: string;
45
+ forceMount?: boolean;
41
46
  } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
42
47
  declare const CommandShortcut: {
43
48
  ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
44
49
  displayName: string;
45
50
  };
46
- export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
51
+ export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, type CommandPrimitive, };
47
52
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAO1D,QAAA,MAAM,OAAO;;;;;;;;;sFAYX,CAAC;AAGH,UAAU,kBAAmB,SAAQ,WAAW;CAAG;AAEnD,QAAA,MAAM,aAAa,2BAA4B,kBAAkB,4CAUhE,CAAC;AAEF,QAAA,MAAM,YAAY;;;0FAehB,CAAC;AAIH,QAAA,MAAM,WAAW;;6HASf,CAAC;AAIH,QAAA,MAAM,YAAY;;6HAShB,CAAC;AAIH,QAAA,MAAM,YAAY;;;;;sFAYhB,CAAC;AAIH,QAAA,MAAM,gBAAgB;;sFASpB,CAAC;AAGH,QAAA,MAAM,WAAW;;;;;;sFAYf,CAAC;AAIH,QAAA,MAAM,eAAe;8BAGlB,MAAM,cAAc,CAAC,eAAe,CAAC;;CAUvC,CAAC;AAGF,OAAO,EACL,OAAO,EACP,aAAa,EACb,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,eAAe,EACf,gBAAgB,GACjB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,MAAM,CAAC;AAEnD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,QAAA,MAAM,OAAO;;;;;;;;;;;sFAYX,CAAC;AAGH,UAAU,kBAAmB,SAAQ,WAAW;CAAG;AAEnD,QAAA,MAAM,aAAa,2BAA4B,kBAAkB,4CAUhE,CAAC;AAEF,QAAA,MAAM,YAAY;;;0FAehB,CAAC;AAIH,QAAA,MAAM,WAAW;;6HASf,CAAC;AAIH,QAAA,MAAM,YAAY;;6HAShB,CAAC;AAIH,QAAA,MAAM,YAAY;;;;;;sFAYhB,CAAC;AAIH,QAAA,MAAM,gBAAgB;;sFASpB,CAAC;AAGH,QAAA,MAAM,WAAW;;;;;;;sFAYf,CAAC;AAIH,QAAA,MAAM,eAAe;8BAGlB,MAAM,cAAc,CAAC,eAAe,CAAC;;CAUvC,CAAC;AAGF,OAAO,EACL,OAAO,EACP,aAAa,EACb,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,KAAK,gBAAgB,GACtB,CAAC"}
package/dist/index.js CHANGED
@@ -37,11 +37,11 @@ var __rest = (this && this.__rest) || function (s, e) {
37
37
  Object.defineProperty(exports, "__esModule", { value: true });
38
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"));
40
+ const dialog_1 = require("@camped-ui/dialog");
41
+ const lib_1 = require("@camped-ui/lib");
41
42
  const cmdk_1 = require("cmdk");
42
43
  const lucide_react_1 = require("lucide-react");
43
- const lib_1 = require("@camped-ui/lib");
44
- const dialog_1 = require("@camped-ui/dialog");
44
+ const React = __importStar(require("react"));
45
45
  const Command = React.forwardRef((_a, ref) => {
46
46
  var { className } = _a, props = __rest(_a, ["className"]);
47
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)));
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,6CAA+B;AAE/B,+BAAmD;AACnD,+CAAsC;AAEtC,wCAAoC;AACpC,8CAA0D;AAE1D,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,CAAC;AA2HD,0BAAO;AA1HT,OAAO,CAAC,WAAW,GAAG,cAAgB,CAAC,WAAW,CAAC;AAInD,MAAM,aAAa,GAAG,CAAC,EAA0C,EAAE,EAAE;QAA9C,EAAE,QAAQ,OAAgC,EAA3B,KAAK,cAApB,YAAsB,CAAF;IACzC,OAAO,CACL,uBAAC,eAAM,oBAAK,KAAK,cACf,uBAAC,sBAAa,IAAC,SAAS,EAAC,+BAA+B,YACtD,uBAAC,OAAO,IAAC,SAAS,EAAC,6WAA6W,YAC7X,QAAQ,GACD,GACI,IACT,CACV,CAAC;AACJ,CAAC,CAAC;AA6GA,sCAAa;AA3Gf,MAAM,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E,EACX,uDAAuD,EACvD,SAAS,CACV,IACG,KAAK,EACT,CACH,CAAC;AACJ,CAAC,CAAC;AAWA,0CAAe;AAVjB,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camped-ui/command",
3
- "version": "2.0.2",
3
+ "version": "2.1.1",
4
4
  "main": "dist/index.js",
5
5
  "scripts": {
6
6
  "publish-package": "npm publish --access public",
@@ -21,6 +21,13 @@
21
21
  "registry": "https://registry.npmjs.org/",
22
22
  "access": "public"
23
23
  },
24
- "author": "IncrescoTech",
25
- "homepage": "https://github.com/incresco#readme"
24
+ "author": "incresco",
25
+ "homepage": "https://ui.camped.academy",
26
+ "keywords": [
27
+ "camped",
28
+ "command",
29
+ "camped-ui",
30
+ "next.js",
31
+ "components"
32
+ ]
26
33
  }