@cmdniels/uikit 1.5.3 → 1.5.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.
@@ -0,0 +1,3 @@
1
+ import { Command as CommandPrimitive } from "cmdk";
2
+ import * as React from "react";
3
+ export default function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ "use client";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { Command as CommandPrimitive } from "cmdk";
15
+ import cn from "../../cn";
16
+ export default function Command(_a) {
17
+ var { className } = _a, props = __rest(_a, ["className"]);
18
+ return (_jsx(CommandPrimitive, Object.assign({ "data-slot": "command", className: cn("flex size-full flex-col overflow-hidden rounded-xl! bg-card p-1 text-card-foreground", className) }, props)));
19
+ }
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ import Dialog from "../../components/dialog/Dialog";
3
+ export default function CommandDialog({ title, description, children, className, showCloseButton, ...props }: Omit<React.ComponentProps<typeof Dialog>, "children"> & {
4
+ title?: string;
5
+ description?: string;
6
+ className?: string;
7
+ showCloseButton?: boolean;
8
+ children: React.ReactNode;
9
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,23 @@
1
+ "use client";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ import cn from "../../cn";
15
+ import Dialog from "../../components/dialog/Dialog";
16
+ import DialogContent from "../../components/dialog/DialogContent";
17
+ import DialogDescription from "../../components/dialog/DialogDescription";
18
+ import DialogHeader from "../../components/dialog/DialogHeader";
19
+ import DialogTitle from "../../components/dialog/DialogTitle";
20
+ export default function CommandDialog(_a) {
21
+ var { title = "Command Palette", description = "Search for a command to run...", children, className, showCloseButton = false } = _a, props = __rest(_a, ["title", "description", "children", "className", "showCloseButton"]);
22
+ return (_jsxs(Dialog, Object.assign({}, props, { children: [_jsxs(DialogHeader, { className: "sr-only", children: [_jsx(DialogTitle, { children: title }), _jsx(DialogDescription, { children: description })] }), _jsx(DialogContent, { className: cn("top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0", className), showCloseButton: showCloseButton, unstyled: true, children: children })] })));
23
+ }
@@ -0,0 +1,3 @@
1
+ import { Command as CommandPrimitive } from "cmdk";
2
+ import * as React from "react";
3
+ export default function CommandEmpty({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ "use client";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { Command as CommandPrimitive } from "cmdk";
15
+ import cn from "../../cn";
16
+ export default function CommandEmpty(_a) {
17
+ var { className } = _a, props = __rest(_a, ["className"]);
18
+ return (_jsx(CommandPrimitive.Empty, Object.assign({ "data-slot": "command-empty", className: cn("py-6 text-center text-sm", className) }, props)));
19
+ }
@@ -0,0 +1,3 @@
1
+ import { Command as CommandPrimitive } from "cmdk";
2
+ import * as React from "react";
3
+ export default function CommandGroup({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ "use client";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { Command as CommandPrimitive } from "cmdk";
15
+ import cn from "../../cn";
16
+ export default function CommandGroup(_a) {
17
+ var { className } = _a, props = __rest(_a, ["className"]);
18
+ return (_jsx(CommandPrimitive.Group, Object.assign({ "data-slot": "command-group", className: cn("overflow-hidden p-1 text-foreground **:[[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-muted-foreground", className) }, props)));
19
+ }
@@ -0,0 +1,3 @@
1
+ import { Command as CommandPrimitive } from "cmdk";
2
+ import * as React from "react";
3
+ export default function CommandInput({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,22 @@
1
+ "use client";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ import { IconSearch } from "@tabler/icons-react";
15
+ import { Command as CommandPrimitive } from "cmdk";
16
+ import cn from "../../cn";
17
+ import InputGroup from "../../components/input-group/InputGroup";
18
+ import InputGroupAddon from "../../components/input-group/InputGroupAddon";
19
+ export default function CommandInput(_a) {
20
+ var { className } = _a, props = __rest(_a, ["className"]);
21
+ return (_jsx("div", { "data-slot": "command-input-wrapper", className: "p-1 pb-0", children: _jsxs(InputGroup, { className: "h-8! rounded-lg! border-border bg-card shadow-none! *:data-[slot=input-group-addon]:pl-2!", children: [_jsx(CommandPrimitive.Input, Object.assign({ "data-slot": "command-input", className: cn("w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50", className) }, props)), _jsx(InputGroupAddon, { children: _jsx(IconSearch, { className: "size-4 shrink-0 opacity-50" }) })] }) }));
22
+ }
@@ -0,0 +1,3 @@
1
+ import { Command as CommandPrimitive } from "cmdk";
2
+ import * as React from "react";
3
+ export default function CommandItem({ className, children, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,20 @@
1
+ "use client";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ import { IconCheck } from "@tabler/icons-react";
15
+ import { Command as CommandPrimitive } from "cmdk";
16
+ import cn from "../../cn";
17
+ export default function CommandItem(_a) {
18
+ var { className, children } = _a, props = __rest(_a, ["className", "children"]);
19
+ return (_jsxs(CommandPrimitive.Item, Object.assign({ "data-slot": "command-item", className: cn("group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground", className) }, props, { children: [children, _jsx(IconCheck, { className: "ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100" })] })));
20
+ }
@@ -0,0 +1,3 @@
1
+ import { Command as CommandPrimitive } from "cmdk";
2
+ import * as React from "react";
3
+ export default function CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ "use client";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { Command as CommandPrimitive } from "cmdk";
15
+ import cn from "../../cn";
16
+ export default function CommandList(_a) {
17
+ var { className } = _a, props = __rest(_a, ["className"]);
18
+ return (_jsx(CommandPrimitive.List, Object.assign({ "data-slot": "command-list", className: cn("scrollbar-none max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none", className) }, props)));
19
+ }
@@ -0,0 +1,3 @@
1
+ import { Command as CommandPrimitive } from "cmdk";
2
+ import * as React from "react";
3
+ export default function CommandSeparator({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ "use client";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { Command as CommandPrimitive } from "cmdk";
15
+ import cn from "../../cn";
16
+ export default function CommandSeparator(_a) {
17
+ var { className } = _a, props = __rest(_a, ["className"]);
18
+ return (_jsx(CommandPrimitive.Separator, Object.assign({ "data-slot": "command-separator", className: cn("-mx-1 h-px bg-border", className) }, props)));
19
+ }
@@ -0,0 +1,2 @@
1
+ import * as React from "react";
2
+ export default function CommandShortcut({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ "use client";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import cn from "../../cn";
15
+ export default function CommandShortcut(_a) {
16
+ var { className } = _a, props = __rest(_a, ["className"]);
17
+ return (_jsx("span", Object.assign({ "data-slot": "command-shortcut", className: cn("ml-auto text-xs tracking-widest text-muted-foreground group-data-selected/command-item:text-foreground", className) }, props)));
18
+ }
@@ -1,4 +1,5 @@
1
1
  import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
2
- export default function DialogContent({ className, children, showCloseButton, ...props }: DialogPrimitive.Popup.Props & {
2
+ export default function DialogContent({ className, children, showCloseButton, unstyled, ...props }: DialogPrimitive.Popup.Props & {
3
3
  showCloseButton?: boolean;
4
+ unstyled?: boolean;
4
5
  }): import("react/jsx-runtime").JSX.Element;
@@ -18,6 +18,6 @@ import Button from "../../components/button/Button";
18
18
  import DialogOverlay from "./DialogOverlay";
19
19
  import DialogPortal from "./DialogPortal";
20
20
  export default function DialogContent(_a) {
21
- var { className, children, showCloseButton = true } = _a, props = __rest(_a, ["className", "children", "showCloseButton"]);
22
- return (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsx(DialogPrimitive.Popup, Object.assign({ "data-slot": "dialog-content", className: cn("fixed top-1/2 left-1/2 z-50 flex h-fit max-h-[calc(100%-2rem)] w-full max-w-[calc(100%-2rem)] -translate-1/2 overflow-hidden rounded-xl ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-md data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className) }, props, { children: _jsxs("div", { className: cn("max-h-[calc(100%-2rem)]", "grid w-full gap-6 overflow-y-auto rounded-xl bg-background p-6 text-sm", "scrollbar-track-background scrollbar-thumb-border scrollbar"), children: [children, showCloseButton && (_jsxs(DialogPrimitive.Close, { "data-slot": "dialog-close", render: _jsx(Button, { variant: "ghost", className: "absolute top-4 right-4", size: "icon-sm" }), children: [_jsx(IconX, {}), _jsx("span", { className: "sr-only", children: "Close" })] }))] }) }))] }));
21
+ var { className, children, showCloseButton = true, unstyled = false } = _a, props = __rest(_a, ["className", "children", "showCloseButton", "unstyled"]);
22
+ return (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsx(DialogPrimitive.Popup, Object.assign({ "data-slot": "dialog-content", className: cn("fixed top-1/2 left-1/2 z-50 flex h-fit max-h-[calc(100%-2rem)] w-full max-w-[calc(100%-2rem)] -translate-1/2 overflow-hidden rounded-xl ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-md data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className) }, props, { children: _jsxs("div", { className: cn("max-h-[calc(100%-2rem)]", "grid w-full gap-6 overflow-y-auto rounded-xl bg-background text-sm", "scrollbar-track-background scrollbar-thumb-border scrollbar", !unstyled && "p-6"), children: [children, showCloseButton && (_jsxs(DialogPrimitive.Close, { "data-slot": "dialog-close", render: _jsx(Button, { variant: "ghost", className: "absolute top-4 right-4", size: "icon-sm" }), children: [_jsx(IconX, {}), _jsx("span", { className: "sr-only", children: "Close" })] }))] }) }))] }));
23
23
  }
package/out/index.d.ts CHANGED
@@ -58,6 +58,15 @@ export { default as ComboboxSeparator } from "./components/combobox/ComboboxSepa
58
58
  export { default as ComboboxTrigger } from "./components/combobox/ComboboxTrigger";
59
59
  export { default as ComboboxValue } from "./components/combobox/ComboboxValue";
60
60
  export { default as useComboboxAnchor } from "./components/combobox/useComboboxAnchor";
61
+ export { default as Command } from "./components/command/Command";
62
+ export { default as CommandDialog } from "./components/command/CommandDialog";
63
+ export { default as CommandEmpty } from "./components/command/CommandEmpty";
64
+ export { default as CommandGroup } from "./components/command/CommandGroup";
65
+ export { default as CommandInput } from "./components/command/CommandInput";
66
+ export { default as CommandItem } from "./components/command/CommandItem";
67
+ export { default as CommandList } from "./components/command/CommandList";
68
+ export { default as CommandSeparator } from "./components/command/CommandSeparator";
69
+ export { default as CommandShortcut } from "./components/command/CommandShortcut";
61
70
  export { default as ContextMenu } from "./components/context-menu/ContextMenu";
62
71
  export { default as ContextMenuCheckboxItem } from "./components/context-menu/ContextMenuCheckboxItem";
63
72
  export { default as ContextMenuContent } from "./components/context-menu/ContextMenuContent";
package/out/index.js CHANGED
@@ -68,6 +68,16 @@ export { default as ComboboxSeparator } from "./components/combobox/ComboboxSepa
68
68
  export { default as ComboboxTrigger } from "./components/combobox/ComboboxTrigger";
69
69
  export { default as ComboboxValue } from "./components/combobox/ComboboxValue";
70
70
  export { default as useComboboxAnchor } from "./components/combobox/useComboboxAnchor";
71
+ // Command
72
+ export { default as Command } from "./components/command/Command";
73
+ export { default as CommandDialog } from "./components/command/CommandDialog";
74
+ export { default as CommandEmpty } from "./components/command/CommandEmpty";
75
+ export { default as CommandGroup } from "./components/command/CommandGroup";
76
+ export { default as CommandInput } from "./components/command/CommandInput";
77
+ export { default as CommandItem } from "./components/command/CommandItem";
78
+ export { default as CommandList } from "./components/command/CommandList";
79
+ export { default as CommandSeparator } from "./components/command/CommandSeparator";
80
+ export { default as CommandShortcut } from "./components/command/CommandShortcut";
71
81
  // Context Menu
72
82
  export { default as ContextMenu } from "./components/context-menu/ContextMenu";
73
83
  export { default as ContextMenuCheckboxItem } from "./components/context-menu/ContextMenuCheckboxItem";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmdniels/uikit",
3
- "version": "1.5.3",
3
+ "version": "1.5.4",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -61,6 +61,7 @@
61
61
  "@tailwindcss/postcss": "^4",
62
62
  "class-variance-authority": "^0.7.1",
63
63
  "clsx": "^2.1.1",
64
+ "cmdk": "^1.1.1",
64
65
  "date-fns": "^4.1.0",
65
66
  "motion": "^12.23.26",
66
67
  "next-themes": "^0.4.6",