notra-editor 0.5.0 → 0.7.0
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/components/blockquote-button/blockquote-button.d.cts +2 -2
- package/dist/components/blockquote-button/blockquote-button.d.ts +2 -2
- package/dist/components/code-block-button/code-block-button.d.cts +2 -2
- package/dist/components/code-block-button/code-block-button.d.ts +2 -2
- package/dist/components/code-block-view/code-block-shell.cjs +41 -0
- package/dist/components/code-block-view/code-block-shell.cjs.map +1 -0
- package/dist/components/code-block-view/code-block-shell.d.cts +11 -0
- package/dist/components/code-block-view/code-block-shell.d.ts +11 -0
- package/dist/components/code-block-view/code-block-shell.mjs +17 -0
- package/dist/components/code-block-view/code-block-shell.mjs.map +1 -0
- package/dist/components/{code-block-view.cjs → code-block-view/code-block-view.cjs} +16 -8
- package/dist/components/code-block-view/code-block-view.cjs.map +1 -0
- package/dist/components/code-block-view/code-block-view.d.cts +6 -0
- package/dist/components/code-block-view/code-block-view.d.ts +6 -0
- package/dist/components/code-block-view/code-block-view.mjs +26 -0
- package/dist/components/code-block-view/code-block-view.mjs.map +1 -0
- package/dist/components/code-block-view/language-select.cjs +91 -0
- package/dist/components/code-block-view/language-select.cjs.map +1 -0
- package/dist/components/code-block-view/language-select.d.cts +11 -0
- package/dist/components/code-block-view/language-select.d.ts +11 -0
- package/dist/components/code-block-view/language-select.mjs +74 -0
- package/dist/components/code-block-view/language-select.mjs.map +1 -0
- package/dist/components/heading-dropdown-menu/heading-dropdown-menu.d.cts +2 -2
- package/dist/components/heading-dropdown-menu/heading-dropdown-menu.d.ts +2 -2
- package/dist/components/heading-dropdown-menu/heading-menu-item.d.cts +2 -2
- package/dist/components/heading-dropdown-menu/heading-menu-item.d.ts +2 -2
- package/dist/components/image-popover/image-popover.d.cts +2 -2
- package/dist/components/image-popover/image-popover.d.ts +2 -2
- package/dist/components/image-popover/use-image-popover.d.cts +3 -3
- package/dist/components/image-popover/use-image-popover.d.ts +3 -3
- package/dist/components/link-popover/link-popover.d.cts +2 -2
- package/dist/components/link-popover/link-popover.d.ts +2 -2
- package/dist/components/link-popover/use-link-popover.d.cts +2 -2
- package/dist/components/link-popover/use-link-popover.d.ts +2 -2
- package/dist/components/list-dropdown-menu/list-dropdown-menu.d.cts +2 -2
- package/dist/components/list-dropdown-menu/list-dropdown-menu.d.ts +2 -2
- package/dist/components/list-dropdown-menu/list-menu-item.d.cts +2 -2
- package/dist/components/list-dropdown-menu/list-menu-item.d.ts +2 -2
- package/dist/components/mark-button/mark-button.d.cts +2 -2
- package/dist/components/mark-button/mark-button.d.ts +2 -2
- package/dist/components/toolbar/toolbar.d.cts +2 -2
- package/dist/components/toolbar/toolbar.d.ts +2 -2
- package/dist/components/ui/button.d.cts +2 -2
- package/dist/components/ui/button.d.ts +2 -2
- package/dist/components/ui/command.cjs +207 -0
- package/dist/components/ui/command.cjs.map +1 -0
- package/dist/components/ui/command.d.cts +22 -0
- package/dist/components/ui/command.d.ts +22 -0
- package/dist/components/ui/command.mjs +181 -0
- package/dist/components/ui/command.mjs.map +1 -0
- package/dist/components/ui/dialog.cjs +188 -0
- package/dist/components/ui/dialog.cjs.map +1 -0
- package/dist/components/ui/dialog.d.cts +20 -0
- package/dist/components/ui/dialog.d.ts +20 -0
- package/dist/components/ui/dialog.mjs +155 -0
- package/dist/components/ui/dialog.mjs.map +1 -0
- package/dist/components/ui/dropdown-menu.cjs +3 -2
- package/dist/components/ui/dropdown-menu.cjs.map +1 -1
- package/dist/components/ui/dropdown-menu.d.cts +16 -16
- package/dist/components/ui/dropdown-menu.d.ts +16 -16
- package/dist/components/ui/dropdown-menu.mjs +3 -2
- package/dist/components/ui/dropdown-menu.mjs.map +1 -1
- package/dist/components/ui/input-group.cjs +175 -0
- package/dist/components/ui/input-group.cjs.map +1 -0
- package/dist/components/ui/input-group.d.cts +20 -0
- package/dist/components/ui/input-group.d.ts +20 -0
- package/dist/components/ui/input-group.mjs +146 -0
- package/dist/components/ui/input-group.mjs.map +1 -0
- package/dist/components/ui/input.cjs +1 -1
- package/dist/components/ui/input.cjs.map +1 -1
- package/dist/components/ui/input.d.cts +2 -2
- package/dist/components/ui/input.d.ts +2 -2
- package/dist/components/ui/input.mjs +1 -1
- package/dist/components/ui/input.mjs.map +1 -1
- package/dist/components/ui/popover.cjs +46 -6
- package/dist/components/ui/popover.cjs.map +1 -1
- package/dist/components/ui/popover.d.cts +9 -6
- package/dist/components/ui/popover.d.ts +9 -6
- package/dist/components/ui/popover.mjs +43 -6
- package/dist/components/ui/popover.mjs.map +1 -1
- package/dist/components/ui/separator.cjs +2 -1
- package/dist/components/ui/separator.cjs.map +1 -1
- package/dist/components/ui/separator.d.cts +2 -2
- package/dist/components/ui/separator.d.ts +2 -2
- package/dist/components/ui/separator.mjs +2 -1
- package/dist/components/ui/separator.mjs.map +1 -1
- package/dist/components/ui/textarea.cjs +43 -0
- package/dist/components/ui/textarea.cjs.map +1 -0
- package/dist/components/ui/textarea.d.cts +6 -0
- package/dist/components/ui/textarea.d.ts +6 -0
- package/dist/components/ui/textarea.mjs +19 -0
- package/dist/components/ui/textarea.mjs.map +1 -0
- package/dist/components/undo-redo-button/undo-redo-button.d.cts +2 -2
- package/dist/components/undo-redo-button/undo-redo-button.d.ts +2 -2
- package/dist/components/undo-redo-button/use-undo-redo.d.cts +2 -2
- package/dist/components/undo-redo-button/use-undo-redo.d.ts +2 -2
- package/dist/extensions/code-block.cjs +76 -19
- package/dist/extensions/code-block.cjs.map +1 -1
- package/dist/extensions/code-block.d.cts +7 -3
- package/dist/extensions/code-block.d.ts +7 -3
- package/dist/extensions/code-block.mjs +73 -8
- package/dist/extensions/code-block.mjs.map +1 -1
- package/dist/extensions/editor.d.cts +3 -3
- package/dist/extensions/editor.d.ts +3 -3
- package/dist/extensions/index.d.cts +1 -1
- package/dist/extensions/index.d.ts +1 -1
- package/dist/extensions/shared.cjs +5 -1
- package/dist/extensions/shared.cjs.map +1 -1
- package/dist/extensions/shared.d.cts +2 -1
- package/dist/extensions/shared.d.ts +2 -1
- package/dist/extensions/shared.mjs +5 -1
- package/dist/extensions/shared.mjs.map +1 -1
- package/dist/index.cjs +20 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.mjs +16 -1
- package/dist/index.mjs.map +1 -1
- package/dist/lib/highlight-code-to-html.cjs +38 -0
- package/dist/lib/highlight-code-to-html.cjs.map +1 -0
- package/dist/lib/highlight-code-to-html.d.cts +6 -0
- package/dist/lib/highlight-code-to-html.d.ts +6 -0
- package/dist/lib/highlight-code-to-html.mjs +14 -0
- package/dist/lib/highlight-code-to-html.mjs.map +1 -0
- package/dist/lib/languages.cjs +181 -0
- package/dist/lib/languages.cjs.map +1 -0
- package/dist/lib/languages.d.cts +24 -0
- package/dist/lib/languages.d.ts +24 -0
- package/dist/lib/languages.mjs +155 -0
- package/dist/lib/languages.mjs.map +1 -0
- package/dist/notra-reader.cjs +32 -3
- package/dist/notra-reader.cjs.map +1 -1
- package/dist/notra-reader.d.cts +11 -1
- package/dist/notra-reader.d.ts +11 -1
- package/dist/notra-reader.mjs +32 -3
- package/dist/notra-reader.mjs.map +1 -1
- package/dist/styles/globals.css +1022 -165
- package/dist/themes/default/editor.css +69 -0
- package/dist/themes/default/shared.css +165 -5
- package/package.json +7 -1
- package/dist/components/code-block-view.cjs.map +0 -1
- package/dist/components/code-block-view.d.cts +0 -12
- package/dist/components/code-block-view.d.ts +0 -12
- package/dist/components/code-block-view.mjs +0 -17
- package/dist/components/code-block-view.mjs.map +0 -1
- package/dist/icons/redo-icon.cjs +0 -54
- package/dist/icons/redo-icon.cjs.map +0 -1
- package/dist/icons/redo-icon.d.cts +0 -7
- package/dist/icons/redo-icon.d.ts +0 -7
- package/dist/icons/redo-icon.mjs +0 -30
- package/dist/icons/redo-icon.mjs.map +0 -1
- package/dist/icons/undo-icon.cjs +0 -54
- package/dist/icons/undo-icon.cjs.map +0 -1
- package/dist/icons/undo-icon.d.cts +0 -7
- package/dist/icons/undo-icon.d.ts +0 -7
- package/dist/icons/undo-icon.mjs +0 -30
- package/dist/icons/undo-icon.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { Editor } from '@tiptap/core';
|
|
3
3
|
|
|
4
4
|
interface UseLinkPopoverConfig {
|
|
@@ -6,7 +6,7 @@ interface UseLinkPopoverConfig {
|
|
|
6
6
|
}
|
|
7
7
|
declare function useLinkPopover({ editor }: UseLinkPopoverConfig): {
|
|
8
8
|
url: string;
|
|
9
|
-
setUrl:
|
|
9
|
+
setUrl: React.Dispatch<React.SetStateAction<string>>;
|
|
10
10
|
isActive: boolean;
|
|
11
11
|
canSet: boolean;
|
|
12
12
|
setLink: () => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { ComponentProps } from 'react';
|
|
3
3
|
import { ListType } from './use-list.cjs';
|
|
4
4
|
import { Button } from '../ui/button.cjs';
|
|
@@ -12,6 +12,6 @@ interface ListDropdownMenuProps extends Omit<ComponentProps<typeof Button>, 'typ
|
|
|
12
12
|
editor: Editor | null;
|
|
13
13
|
types?: ListType[];
|
|
14
14
|
}
|
|
15
|
-
declare const ListDropdownMenu:
|
|
15
|
+
declare const ListDropdownMenu: React.ForwardRefExoticComponent<Omit<ListDropdownMenuProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
16
16
|
|
|
17
17
|
export { ListDropdownMenu, type ListDropdownMenuProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { ComponentProps } from 'react';
|
|
3
3
|
import { ListType } from './use-list.js';
|
|
4
4
|
import { Button } from '../ui/button.js';
|
|
@@ -12,6 +12,6 @@ interface ListDropdownMenuProps extends Omit<ComponentProps<typeof Button>, 'typ
|
|
|
12
12
|
editor: Editor | null;
|
|
13
13
|
types?: ListType[];
|
|
14
14
|
}
|
|
15
|
-
declare const ListDropdownMenu:
|
|
15
|
+
declare const ListDropdownMenu: React.ForwardRefExoticComponent<Omit<ListDropdownMenuProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
16
16
|
|
|
17
17
|
export { ListDropdownMenu, type ListDropdownMenuProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { ListType } from './use-list.cjs';
|
|
3
3
|
import { Editor } from '@tiptap/core';
|
|
4
4
|
import 'lucide-react';
|
|
@@ -7,6 +7,6 @@ interface ListMenuItemProps {
|
|
|
7
7
|
editor: Editor | null;
|
|
8
8
|
listType: ListType;
|
|
9
9
|
}
|
|
10
|
-
declare const ListMenuItem:
|
|
10
|
+
declare const ListMenuItem: React.ForwardRefExoticComponent<ListMenuItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
11
11
|
|
|
12
12
|
export { ListMenuItem, type ListMenuItemProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { ListType } from './use-list.js';
|
|
3
3
|
import { Editor } from '@tiptap/core';
|
|
4
4
|
import 'lucide-react';
|
|
@@ -7,6 +7,6 @@ interface ListMenuItemProps {
|
|
|
7
7
|
editor: Editor | null;
|
|
8
8
|
listType: ListType;
|
|
9
9
|
}
|
|
10
|
-
declare const ListMenuItem:
|
|
10
|
+
declare const ListMenuItem: React.ForwardRefExoticComponent<ListMenuItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
11
11
|
|
|
12
12
|
export { ListMenuItem, type ListMenuItemProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
2
|
import { MarkType } from './use-mark.cjs';
|
|
3
3
|
import { Editor } from '@tiptap/core';
|
|
4
4
|
import 'lucide-react';
|
|
@@ -7,6 +7,6 @@ interface MarkButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElem
|
|
|
7
7
|
editor: Editor | null;
|
|
8
8
|
type: MarkType;
|
|
9
9
|
}
|
|
10
|
-
declare const MarkButton:
|
|
10
|
+
declare const MarkButton: React$1.ForwardRefExoticComponent<MarkButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
11
11
|
|
|
12
12
|
export { MarkButton, type MarkButtonProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
2
|
import { MarkType } from './use-mark.js';
|
|
3
3
|
import { Editor } from '@tiptap/core';
|
|
4
4
|
import 'lucide-react';
|
|
@@ -7,6 +7,6 @@ interface MarkButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElem
|
|
|
7
7
|
editor: Editor | null;
|
|
8
8
|
type: MarkType;
|
|
9
9
|
}
|
|
10
|
-
declare const MarkButton:
|
|
10
|
+
declare const MarkButton: React$1.ForwardRefExoticComponent<MarkButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
11
11
|
|
|
12
12
|
export { MarkButton, type MarkButtonProps };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as
|
|
2
|
+
import * as React$1 from 'react';
|
|
3
3
|
|
|
4
4
|
interface ToolbarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
5
|
variant?: 'fixed' | 'floating';
|
|
6
6
|
}
|
|
7
|
-
declare const Toolbar:
|
|
7
|
+
declare const Toolbar: React$1.ForwardRefExoticComponent<ToolbarProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
8
8
|
declare function ToolbarGroup({ children, className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
9
9
|
interface ToolbarSeparatorProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
10
10
|
orientation?: 'horizontal' | 'vertical';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as
|
|
2
|
+
import * as React$1 from 'react';
|
|
3
3
|
|
|
4
4
|
interface ToolbarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
5
|
variant?: 'fixed' | 'floating';
|
|
6
6
|
}
|
|
7
|
-
declare const Toolbar:
|
|
7
|
+
declare const Toolbar: React$1.ForwardRefExoticComponent<ToolbarProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
8
8
|
declare function ToolbarGroup({ children, className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
9
9
|
interface ToolbarSeparatorProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
10
10
|
orientation?: 'horizontal' | 'vertical';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
|
-
import * as
|
|
4
|
+
import * as React from 'react';
|
|
5
5
|
|
|
6
6
|
declare const buttonVariants: (props?: ({
|
|
7
7
|
variant?: "default" | "outline" | "secondary" | "ghost" | "destructive" | "link" | null | undefined;
|
|
8
8
|
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
9
9
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
|
-
declare function Button({ className, variant, size, asChild, ...props }:
|
|
10
|
+
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
|
|
11
11
|
asChild?: boolean;
|
|
12
12
|
}): react_jsx_runtime.JSX.Element;
|
|
13
13
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
|
-
import * as
|
|
4
|
+
import * as React from 'react';
|
|
5
5
|
|
|
6
6
|
declare const buttonVariants: (props?: ({
|
|
7
7
|
variant?: "default" | "outline" | "secondary" | "ghost" | "destructive" | "link" | null | undefined;
|
|
8
8
|
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
9
9
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
|
-
declare function Button({ className, variant, size, asChild, ...props }:
|
|
10
|
+
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
|
|
11
11
|
asChild?: boolean;
|
|
12
12
|
}): react_jsx_runtime.JSX.Element;
|
|
13
13
|
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var command_exports = {};
|
|
21
|
+
__export(command_exports, {
|
|
22
|
+
Command: () => Command,
|
|
23
|
+
CommandDialog: () => CommandDialog,
|
|
24
|
+
CommandEmpty: () => CommandEmpty,
|
|
25
|
+
CommandGroup: () => CommandGroup,
|
|
26
|
+
CommandInput: () => CommandInput,
|
|
27
|
+
CommandItem: () => CommandItem,
|
|
28
|
+
CommandList: () => CommandList,
|
|
29
|
+
CommandSeparator: () => CommandSeparator,
|
|
30
|
+
CommandShortcut: () => CommandShortcut
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(command_exports);
|
|
33
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
34
|
+
var import_cmdk = require("cmdk");
|
|
35
|
+
var import_lucide_react = require("lucide-react");
|
|
36
|
+
var import_dialog = require("./dialog");
|
|
37
|
+
var import_input_group = require("./input-group");
|
|
38
|
+
var import_utils = require("../../lib/utils");
|
|
39
|
+
function Command({
|
|
40
|
+
className,
|
|
41
|
+
...props
|
|
42
|
+
}) {
|
|
43
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
44
|
+
import_cmdk.Command,
|
|
45
|
+
{
|
|
46
|
+
className: (0, import_utils.cn)(
|
|
47
|
+
"nt:flex nt:size-full nt:flex-col nt:overflow-hidden nt:rounded-xl! nt:bg-popover nt:p-1 nt:text-popover-foreground",
|
|
48
|
+
className
|
|
49
|
+
),
|
|
50
|
+
"data-slot": "command",
|
|
51
|
+
...props
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
function CommandDialog({
|
|
56
|
+
title = "Command Palette",
|
|
57
|
+
description = "Search for a command to run...",
|
|
58
|
+
children,
|
|
59
|
+
className,
|
|
60
|
+
showCloseButton = false,
|
|
61
|
+
...props
|
|
62
|
+
}) {
|
|
63
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dialog.Dialog, { ...props, children: [
|
|
64
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dialog.DialogHeader, { className: "nt:sr-only", children: [
|
|
65
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogTitle, { children: title }),
|
|
66
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogDescription, { children: description })
|
|
67
|
+
] }),
|
|
68
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
69
|
+
import_dialog.DialogContent,
|
|
70
|
+
{
|
|
71
|
+
className: (0, import_utils.cn)(
|
|
72
|
+
"nt:top-1/3 nt:translate-y-0 nt:overflow-hidden nt:rounded-xl! nt:p-0",
|
|
73
|
+
className
|
|
74
|
+
),
|
|
75
|
+
showCloseButton,
|
|
76
|
+
children
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
] });
|
|
80
|
+
}
|
|
81
|
+
function CommandInput({
|
|
82
|
+
className,
|
|
83
|
+
...props
|
|
84
|
+
}) {
|
|
85
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "nt:p-1 nt:pb-0", "data-slot": "command-input-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_input_group.InputGroup, { className: "nt:h-8! nt:rounded-lg! nt:border-input/30 nt:bg-input/30 nt:shadow-none! nt:*:data-[slot=input-group-addon]:pl-2!", children: [
|
|
86
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
87
|
+
import_cmdk.Command.Input,
|
|
88
|
+
{
|
|
89
|
+
className: (0, import_utils.cn)(
|
|
90
|
+
"nt:w-full nt:text-sm nt:outline-hidden nt:disabled:cursor-not-allowed nt:disabled:opacity-50",
|
|
91
|
+
className
|
|
92
|
+
),
|
|
93
|
+
"data-slot": "command-input",
|
|
94
|
+
...props
|
|
95
|
+
}
|
|
96
|
+
),
|
|
97
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_input_group.InputGroupAddon, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.SearchIcon, { className: "nt:size-4 nt:shrink-0 nt:opacity-50" }) })
|
|
98
|
+
] }) });
|
|
99
|
+
}
|
|
100
|
+
function CommandList({
|
|
101
|
+
className,
|
|
102
|
+
...props
|
|
103
|
+
}) {
|
|
104
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
105
|
+
import_cmdk.Command.List,
|
|
106
|
+
{
|
|
107
|
+
className: (0, import_utils.cn)(
|
|
108
|
+
"nt:no-scrollbar nt:max-h-72 nt:scroll-py-1 nt:overflow-x-hidden nt:overflow-y-auto nt:outline-none",
|
|
109
|
+
className
|
|
110
|
+
),
|
|
111
|
+
"data-slot": "command-list",
|
|
112
|
+
...props
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
function CommandEmpty({
|
|
117
|
+
className,
|
|
118
|
+
...props
|
|
119
|
+
}) {
|
|
120
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
121
|
+
import_cmdk.Command.Empty,
|
|
122
|
+
{
|
|
123
|
+
className: (0, import_utils.cn)("nt:py-6 nt:text-center nt:text-sm", className),
|
|
124
|
+
"data-slot": "command-empty",
|
|
125
|
+
...props
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
function CommandGroup({
|
|
130
|
+
className,
|
|
131
|
+
...props
|
|
132
|
+
}) {
|
|
133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
134
|
+
import_cmdk.Command.Group,
|
|
135
|
+
{
|
|
136
|
+
className: (0, import_utils.cn)(
|
|
137
|
+
"nt:overflow-hidden nt:p-1 nt:text-foreground nt:**:[[cmdk-group-heading]]:px-2 nt:**:[[cmdk-group-heading]]:py-1.5 nt:**:[[cmdk-group-heading]]:text-xs nt:**:[[cmdk-group-heading]]:font-medium nt:**:[[cmdk-group-heading]]:text-muted-foreground",
|
|
138
|
+
className
|
|
139
|
+
),
|
|
140
|
+
"data-slot": "command-group",
|
|
141
|
+
...props
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
function CommandSeparator({
|
|
146
|
+
className,
|
|
147
|
+
...props
|
|
148
|
+
}) {
|
|
149
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
150
|
+
import_cmdk.Command.Separator,
|
|
151
|
+
{
|
|
152
|
+
className: (0, import_utils.cn)("nt:-mx-1 nt:h-px nt:bg-border", className),
|
|
153
|
+
"data-slot": "command-separator",
|
|
154
|
+
...props
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
function CommandItem({
|
|
159
|
+
className,
|
|
160
|
+
children,
|
|
161
|
+
...props
|
|
162
|
+
}) {
|
|
163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
164
|
+
import_cmdk.Command.Item,
|
|
165
|
+
{
|
|
166
|
+
className: (0, import_utils.cn)(
|
|
167
|
+
"nt:group/command-item nt:relative nt:flex nt:cursor-default nt:items-center nt:gap-2 nt:rounded-sm nt:px-2 nt:py-1.5 nt:text-sm nt:outline-hidden nt:select-none nt:in-data-[slot=dialog-content]:rounded-lg! nt:data-[disabled=true]:pointer-events-none nt:data-[disabled=true]:opacity-50 nt:data-selected:bg-muted nt:data-selected:text-foreground nt:[&_svg]:pointer-events-none nt:[&_svg]:shrink-0 nt:[&_svg:not([class*=size-])]:size-4 nt:data-selected:*:[svg]:text-foreground",
|
|
168
|
+
className
|
|
169
|
+
),
|
|
170
|
+
"data-slot": "command-item",
|
|
171
|
+
...props,
|
|
172
|
+
children: [
|
|
173
|
+
children,
|
|
174
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.CheckIcon, { className: "nt:ml-auto nt:opacity-0 nt:group-has-data-[slot=command-shortcut]/command-item:hidden nt:group-data-[checked=true]/command-item:opacity-100" })
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
function CommandShortcut({
|
|
180
|
+
className,
|
|
181
|
+
...props
|
|
182
|
+
}) {
|
|
183
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
184
|
+
"span",
|
|
185
|
+
{
|
|
186
|
+
className: (0, import_utils.cn)(
|
|
187
|
+
"nt:ml-auto nt:text-xs nt:tracking-widest nt:text-muted-foreground nt:group-data-selected/command-item:text-foreground",
|
|
188
|
+
className
|
|
189
|
+
),
|
|
190
|
+
"data-slot": "command-shortcut",
|
|
191
|
+
...props
|
|
192
|
+
}
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
196
|
+
0 && (module.exports = {
|
|
197
|
+
Command,
|
|
198
|
+
CommandDialog,
|
|
199
|
+
CommandEmpty,
|
|
200
|
+
CommandGroup,
|
|
201
|
+
CommandInput,
|
|
202
|
+
CommandItem,
|
|
203
|
+
CommandList,
|
|
204
|
+
CommandSeparator,
|
|
205
|
+
CommandShortcut
|
|
206
|
+
});
|
|
207
|
+
//# sourceMappingURL=command.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/command.tsx"],"sourcesContent":["'use client';\n\nimport { Command as CommandPrimitive } from 'cmdk';\nimport { SearchIcon, CheckIcon } from 'lucide-react';\nimport * as React from 'react';\n\nimport {\n\tDialog,\n\tDialogContent,\n\tDialogDescription,\n\tDialogHeader,\n\tDialogTitle\n} from './dialog';\nimport { InputGroup, InputGroupAddon } from './input-group';\nimport { cn } from '../../lib/utils';\n\nfunction Command({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive>) {\n\treturn (\n\t\t<CommandPrimitive\n\t\t\tclassName={cn(\n\t\t\t\t'nt:flex nt:size-full nt:flex-col nt:overflow-hidden nt:rounded-xl! nt:bg-popover nt:p-1 nt:text-popover-foreground',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-slot=\"command\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandDialog({\n\ttitle = 'Command Palette',\n\tdescription = 'Search for a command to run...',\n\tchildren,\n\tclassName,\n\tshowCloseButton = false,\n\t...props\n}: React.ComponentProps<typeof Dialog> & {\n\ttitle?: string;\n\tdescription?: string;\n\tclassName?: string;\n\tshowCloseButton?: boolean;\n}) {\n\treturn (\n\t\t<Dialog {...props}>\n\t\t\t<DialogHeader className=\"nt:sr-only\">\n\t\t\t\t<DialogTitle>{title}</DialogTitle>\n\t\t\t\t<DialogDescription>{description}</DialogDescription>\n\t\t\t</DialogHeader>\n\t\t\t<DialogContent\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'nt:top-1/3 nt:translate-y-0 nt:overflow-hidden nt:rounded-xl! nt:p-0',\n\t\t\t\t\tclassName\n\t\t\t\t)}\n\t\t\t\tshowCloseButton={showCloseButton}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</DialogContent>\n\t\t</Dialog>\n\t);\n}\n\nfunction CommandInput({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Input>) {\n\treturn (\n\t\t<div className=\"nt:p-1 nt:pb-0\" data-slot=\"command-input-wrapper\">\n\t\t\t<InputGroup className=\"nt:h-8! nt:rounded-lg! nt:border-input/30 nt:bg-input/30 nt:shadow-none! nt:*:data-[slot=input-group-addon]:pl-2!\">\n\t\t\t\t<CommandPrimitive.Input\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'nt:w-full nt:text-sm nt:outline-hidden nt:disabled:cursor-not-allowed nt:disabled:opacity-50',\n\t\t\t\t\t\tclassName\n\t\t\t\t\t)}\n\t\t\t\t\tdata-slot=\"command-input\"\n\t\t\t\t\t{...props}\n\t\t\t\t/>\n\t\t\t\t<InputGroupAddon>\n\t\t\t\t\t<SearchIcon className=\"nt:size-4 nt:shrink-0 nt:opacity-50\" />\n\t\t\t\t</InputGroupAddon>\n\t\t\t</InputGroup>\n\t\t</div>\n\t);\n}\n\nfunction CommandList({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.List>) {\n\treturn (\n\t\t<CommandPrimitive.List\n\t\t\tclassName={cn(\n\t\t\t\t'nt:no-scrollbar nt:max-h-72 nt:scroll-py-1 nt:overflow-x-hidden nt:overflow-y-auto nt:outline-none',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-slot=\"command-list\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandEmpty({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Empty>) {\n\treturn (\n\t\t<CommandPrimitive.Empty\n\t\t\tclassName={cn('nt:py-6 nt:text-center nt:text-sm', className)}\n\t\t\tdata-slot=\"command-empty\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandGroup({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Group>) {\n\treturn (\n\t\t<CommandPrimitive.Group\n\t\t\tclassName={cn(\n\t\t\t\t'nt:overflow-hidden nt:p-1 nt:text-foreground nt:**:[[cmdk-group-heading]]:px-2 nt:**:[[cmdk-group-heading]]:py-1.5 nt:**:[[cmdk-group-heading]]:text-xs nt:**:[[cmdk-group-heading]]:font-medium nt:**:[[cmdk-group-heading]]:text-muted-foreground',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-slot=\"command-group\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandSeparator({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Separator>) {\n\treturn (\n\t\t<CommandPrimitive.Separator\n\t\t\tclassName={cn('nt:-mx-1 nt:h-px nt:bg-border', className)}\n\t\t\tdata-slot=\"command-separator\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandItem({\n\tclassName,\n\tchildren,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Item>) {\n\treturn (\n\t\t<CommandPrimitive.Item\n\t\t\tclassName={cn(\n\t\t\t\t'nt:group/command-item nt:relative nt:flex nt:cursor-default nt:items-center nt:gap-2 nt:rounded-sm nt:px-2 nt:py-1.5 nt:text-sm nt:outline-hidden nt:select-none nt:in-data-[slot=dialog-content]:rounded-lg! nt:data-[disabled=true]:pointer-events-none nt:data-[disabled=true]:opacity-50 nt:data-selected:bg-muted nt:data-selected:text-foreground nt:[&_svg]:pointer-events-none nt:[&_svg]:shrink-0 nt:[&_svg:not([class*=size-])]:size-4 nt:data-selected:*:[svg]:text-foreground',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-slot=\"command-item\"\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t\t<CheckIcon className=\"nt:ml-auto nt:opacity-0 nt:group-has-data-[slot=command-shortcut]/command-item:hidden nt:group-data-[checked=true]/command-item:opacity-100\" />\n\t\t</CommandPrimitive.Item>\n\t);\n}\n\nfunction CommandShortcut({\n\tclassName,\n\t...props\n}: React.ComponentProps<'span'>) {\n\treturn (\n\t\t<span\n\t\t\tclassName={cn(\n\t\t\t\t'nt:ml-auto nt:text-xs nt:tracking-widest nt:text-muted-foreground nt:group-data-selected/command-item:text-foreground',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-slot=\"command-shortcut\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tCommand,\n\tCommandDialog,\n\tCommandInput,\n\tCommandList,\n\tCommandEmpty,\n\tCommandGroup,\n\tCommandItem,\n\tCommandShortcut,\n\tCommandSeparator\n};\n"],"mappings":"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","names":["CommandPrimitive"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { Command as Command$1 } from 'cmdk';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Dialog } from './dialog.cjs';
|
|
5
|
+
import 'radix-ui';
|
|
6
|
+
|
|
7
|
+
declare function Command({ className, ...props }: React.ComponentProps<typeof Command$1>): react_jsx_runtime.JSX.Element;
|
|
8
|
+
declare function CommandDialog({ title, description, children, className, showCloseButton, ...props }: React.ComponentProps<typeof Dialog> & {
|
|
9
|
+
title?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
showCloseButton?: boolean;
|
|
13
|
+
}): react_jsx_runtime.JSX.Element;
|
|
14
|
+
declare function CommandInput({ className, ...props }: React.ComponentProps<typeof Command$1.Input>): react_jsx_runtime.JSX.Element;
|
|
15
|
+
declare function CommandList({ className, ...props }: React.ComponentProps<typeof Command$1.List>): react_jsx_runtime.JSX.Element;
|
|
16
|
+
declare function CommandEmpty({ className, ...props }: React.ComponentProps<typeof Command$1.Empty>): react_jsx_runtime.JSX.Element;
|
|
17
|
+
declare function CommandGroup({ className, ...props }: React.ComponentProps<typeof Command$1.Group>): react_jsx_runtime.JSX.Element;
|
|
18
|
+
declare function CommandSeparator({ className, ...props }: React.ComponentProps<typeof Command$1.Separator>): react_jsx_runtime.JSX.Element;
|
|
19
|
+
declare function CommandItem({ className, children, ...props }: React.ComponentProps<typeof Command$1.Item>): react_jsx_runtime.JSX.Element;
|
|
20
|
+
declare function CommandShortcut({ className, ...props }: React.ComponentProps<'span'>): react_jsx_runtime.JSX.Element;
|
|
21
|
+
|
|
22
|
+
export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { Command as Command$1 } from 'cmdk';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Dialog } from './dialog.js';
|
|
5
|
+
import 'radix-ui';
|
|
6
|
+
|
|
7
|
+
declare function Command({ className, ...props }: React.ComponentProps<typeof Command$1>): react_jsx_runtime.JSX.Element;
|
|
8
|
+
declare function CommandDialog({ title, description, children, className, showCloseButton, ...props }: React.ComponentProps<typeof Dialog> & {
|
|
9
|
+
title?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
showCloseButton?: boolean;
|
|
13
|
+
}): react_jsx_runtime.JSX.Element;
|
|
14
|
+
declare function CommandInput({ className, ...props }: React.ComponentProps<typeof Command$1.Input>): react_jsx_runtime.JSX.Element;
|
|
15
|
+
declare function CommandList({ className, ...props }: React.ComponentProps<typeof Command$1.List>): react_jsx_runtime.JSX.Element;
|
|
16
|
+
declare function CommandEmpty({ className, ...props }: React.ComponentProps<typeof Command$1.Empty>): react_jsx_runtime.JSX.Element;
|
|
17
|
+
declare function CommandGroup({ className, ...props }: React.ComponentProps<typeof Command$1.Group>): react_jsx_runtime.JSX.Element;
|
|
18
|
+
declare function CommandSeparator({ className, ...props }: React.ComponentProps<typeof Command$1.Separator>): react_jsx_runtime.JSX.Element;
|
|
19
|
+
declare function CommandItem({ className, children, ...props }: React.ComponentProps<typeof Command$1.Item>): react_jsx_runtime.JSX.Element;
|
|
20
|
+
declare function CommandShortcut({ className, ...props }: React.ComponentProps<'span'>): react_jsx_runtime.JSX.Element;
|
|
21
|
+
|
|
22
|
+
export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut };
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Command as CommandPrimitive } from "cmdk";
|
|
4
|
+
import { SearchIcon, CheckIcon } from "lucide-react";
|
|
5
|
+
import {
|
|
6
|
+
Dialog,
|
|
7
|
+
DialogContent,
|
|
8
|
+
DialogDescription,
|
|
9
|
+
DialogHeader,
|
|
10
|
+
DialogTitle
|
|
11
|
+
} from "./dialog";
|
|
12
|
+
import { InputGroup, InputGroupAddon } from "./input-group";
|
|
13
|
+
import { cn } from "../../lib/utils";
|
|
14
|
+
function Command({
|
|
15
|
+
className,
|
|
16
|
+
...props
|
|
17
|
+
}) {
|
|
18
|
+
return /* @__PURE__ */ jsx(
|
|
19
|
+
CommandPrimitive,
|
|
20
|
+
{
|
|
21
|
+
className: cn(
|
|
22
|
+
"nt:flex nt:size-full nt:flex-col nt:overflow-hidden nt:rounded-xl! nt:bg-popover nt:p-1 nt:text-popover-foreground",
|
|
23
|
+
className
|
|
24
|
+
),
|
|
25
|
+
"data-slot": "command",
|
|
26
|
+
...props
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
function CommandDialog({
|
|
31
|
+
title = "Command Palette",
|
|
32
|
+
description = "Search for a command to run...",
|
|
33
|
+
children,
|
|
34
|
+
className,
|
|
35
|
+
showCloseButton = false,
|
|
36
|
+
...props
|
|
37
|
+
}) {
|
|
38
|
+
return /* @__PURE__ */ jsxs(Dialog, { ...props, children: [
|
|
39
|
+
/* @__PURE__ */ jsxs(DialogHeader, { className: "nt:sr-only", children: [
|
|
40
|
+
/* @__PURE__ */ jsx(DialogTitle, { children: title }),
|
|
41
|
+
/* @__PURE__ */ jsx(DialogDescription, { children: description })
|
|
42
|
+
] }),
|
|
43
|
+
/* @__PURE__ */ jsx(
|
|
44
|
+
DialogContent,
|
|
45
|
+
{
|
|
46
|
+
className: cn(
|
|
47
|
+
"nt:top-1/3 nt:translate-y-0 nt:overflow-hidden nt:rounded-xl! nt:p-0",
|
|
48
|
+
className
|
|
49
|
+
),
|
|
50
|
+
showCloseButton,
|
|
51
|
+
children
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
] });
|
|
55
|
+
}
|
|
56
|
+
function CommandInput({
|
|
57
|
+
className,
|
|
58
|
+
...props
|
|
59
|
+
}) {
|
|
60
|
+
return /* @__PURE__ */ jsx("div", { className: "nt:p-1 nt:pb-0", "data-slot": "command-input-wrapper", children: /* @__PURE__ */ jsxs(InputGroup, { className: "nt:h-8! nt:rounded-lg! nt:border-input/30 nt:bg-input/30 nt:shadow-none! nt:*:data-[slot=input-group-addon]:pl-2!", children: [
|
|
61
|
+
/* @__PURE__ */ jsx(
|
|
62
|
+
CommandPrimitive.Input,
|
|
63
|
+
{
|
|
64
|
+
className: cn(
|
|
65
|
+
"nt:w-full nt:text-sm nt:outline-hidden nt:disabled:cursor-not-allowed nt:disabled:opacity-50",
|
|
66
|
+
className
|
|
67
|
+
),
|
|
68
|
+
"data-slot": "command-input",
|
|
69
|
+
...props
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
/* @__PURE__ */ jsx(InputGroupAddon, { children: /* @__PURE__ */ jsx(SearchIcon, { className: "nt:size-4 nt:shrink-0 nt:opacity-50" }) })
|
|
73
|
+
] }) });
|
|
74
|
+
}
|
|
75
|
+
function CommandList({
|
|
76
|
+
className,
|
|
77
|
+
...props
|
|
78
|
+
}) {
|
|
79
|
+
return /* @__PURE__ */ jsx(
|
|
80
|
+
CommandPrimitive.List,
|
|
81
|
+
{
|
|
82
|
+
className: cn(
|
|
83
|
+
"nt:no-scrollbar nt:max-h-72 nt:scroll-py-1 nt:overflow-x-hidden nt:overflow-y-auto nt:outline-none",
|
|
84
|
+
className
|
|
85
|
+
),
|
|
86
|
+
"data-slot": "command-list",
|
|
87
|
+
...props
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
function CommandEmpty({
|
|
92
|
+
className,
|
|
93
|
+
...props
|
|
94
|
+
}) {
|
|
95
|
+
return /* @__PURE__ */ jsx(
|
|
96
|
+
CommandPrimitive.Empty,
|
|
97
|
+
{
|
|
98
|
+
className: cn("nt:py-6 nt:text-center nt:text-sm", className),
|
|
99
|
+
"data-slot": "command-empty",
|
|
100
|
+
...props
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
function CommandGroup({
|
|
105
|
+
className,
|
|
106
|
+
...props
|
|
107
|
+
}) {
|
|
108
|
+
return /* @__PURE__ */ jsx(
|
|
109
|
+
CommandPrimitive.Group,
|
|
110
|
+
{
|
|
111
|
+
className: cn(
|
|
112
|
+
"nt:overflow-hidden nt:p-1 nt:text-foreground nt:**:[[cmdk-group-heading]]:px-2 nt:**:[[cmdk-group-heading]]:py-1.5 nt:**:[[cmdk-group-heading]]:text-xs nt:**:[[cmdk-group-heading]]:font-medium nt:**:[[cmdk-group-heading]]:text-muted-foreground",
|
|
113
|
+
className
|
|
114
|
+
),
|
|
115
|
+
"data-slot": "command-group",
|
|
116
|
+
...props
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
function CommandSeparator({
|
|
121
|
+
className,
|
|
122
|
+
...props
|
|
123
|
+
}) {
|
|
124
|
+
return /* @__PURE__ */ jsx(
|
|
125
|
+
CommandPrimitive.Separator,
|
|
126
|
+
{
|
|
127
|
+
className: cn("nt:-mx-1 nt:h-px nt:bg-border", className),
|
|
128
|
+
"data-slot": "command-separator",
|
|
129
|
+
...props
|
|
130
|
+
}
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
function CommandItem({
|
|
134
|
+
className,
|
|
135
|
+
children,
|
|
136
|
+
...props
|
|
137
|
+
}) {
|
|
138
|
+
return /* @__PURE__ */ jsxs(
|
|
139
|
+
CommandPrimitive.Item,
|
|
140
|
+
{
|
|
141
|
+
className: cn(
|
|
142
|
+
"nt:group/command-item nt:relative nt:flex nt:cursor-default nt:items-center nt:gap-2 nt:rounded-sm nt:px-2 nt:py-1.5 nt:text-sm nt:outline-hidden nt:select-none nt:in-data-[slot=dialog-content]:rounded-lg! nt:data-[disabled=true]:pointer-events-none nt:data-[disabled=true]:opacity-50 nt:data-selected:bg-muted nt:data-selected:text-foreground nt:[&_svg]:pointer-events-none nt:[&_svg]:shrink-0 nt:[&_svg:not([class*=size-])]:size-4 nt:data-selected:*:[svg]:text-foreground",
|
|
143
|
+
className
|
|
144
|
+
),
|
|
145
|
+
"data-slot": "command-item",
|
|
146
|
+
...props,
|
|
147
|
+
children: [
|
|
148
|
+
children,
|
|
149
|
+
/* @__PURE__ */ jsx(CheckIcon, { className: "nt:ml-auto nt:opacity-0 nt:group-has-data-[slot=command-shortcut]/command-item:hidden nt:group-data-[checked=true]/command-item:opacity-100" })
|
|
150
|
+
]
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
function CommandShortcut({
|
|
155
|
+
className,
|
|
156
|
+
...props
|
|
157
|
+
}) {
|
|
158
|
+
return /* @__PURE__ */ jsx(
|
|
159
|
+
"span",
|
|
160
|
+
{
|
|
161
|
+
className: cn(
|
|
162
|
+
"nt:ml-auto nt:text-xs nt:tracking-widest nt:text-muted-foreground nt:group-data-selected/command-item:text-foreground",
|
|
163
|
+
className
|
|
164
|
+
),
|
|
165
|
+
"data-slot": "command-shortcut",
|
|
166
|
+
...props
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
export {
|
|
171
|
+
Command,
|
|
172
|
+
CommandDialog,
|
|
173
|
+
CommandEmpty,
|
|
174
|
+
CommandGroup,
|
|
175
|
+
CommandInput,
|
|
176
|
+
CommandItem,
|
|
177
|
+
CommandList,
|
|
178
|
+
CommandSeparator,
|
|
179
|
+
CommandShortcut
|
|
180
|
+
};
|
|
181
|
+
//# sourceMappingURL=command.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/command.tsx"],"sourcesContent":["'use client';\n\nimport { Command as CommandPrimitive } from 'cmdk';\nimport { SearchIcon, CheckIcon } from 'lucide-react';\nimport * as React from 'react';\n\nimport {\n\tDialog,\n\tDialogContent,\n\tDialogDescription,\n\tDialogHeader,\n\tDialogTitle\n} from './dialog';\nimport { InputGroup, InputGroupAddon } from './input-group';\nimport { cn } from '../../lib/utils';\n\nfunction Command({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive>) {\n\treturn (\n\t\t<CommandPrimitive\n\t\t\tclassName={cn(\n\t\t\t\t'nt:flex nt:size-full nt:flex-col nt:overflow-hidden nt:rounded-xl! nt:bg-popover nt:p-1 nt:text-popover-foreground',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-slot=\"command\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandDialog({\n\ttitle = 'Command Palette',\n\tdescription = 'Search for a command to run...',\n\tchildren,\n\tclassName,\n\tshowCloseButton = false,\n\t...props\n}: React.ComponentProps<typeof Dialog> & {\n\ttitle?: string;\n\tdescription?: string;\n\tclassName?: string;\n\tshowCloseButton?: boolean;\n}) {\n\treturn (\n\t\t<Dialog {...props}>\n\t\t\t<DialogHeader className=\"nt:sr-only\">\n\t\t\t\t<DialogTitle>{title}</DialogTitle>\n\t\t\t\t<DialogDescription>{description}</DialogDescription>\n\t\t\t</DialogHeader>\n\t\t\t<DialogContent\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'nt:top-1/3 nt:translate-y-0 nt:overflow-hidden nt:rounded-xl! nt:p-0',\n\t\t\t\t\tclassName\n\t\t\t\t)}\n\t\t\t\tshowCloseButton={showCloseButton}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</DialogContent>\n\t\t</Dialog>\n\t);\n}\n\nfunction CommandInput({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Input>) {\n\treturn (\n\t\t<div className=\"nt:p-1 nt:pb-0\" data-slot=\"command-input-wrapper\">\n\t\t\t<InputGroup className=\"nt:h-8! nt:rounded-lg! nt:border-input/30 nt:bg-input/30 nt:shadow-none! nt:*:data-[slot=input-group-addon]:pl-2!\">\n\t\t\t\t<CommandPrimitive.Input\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'nt:w-full nt:text-sm nt:outline-hidden nt:disabled:cursor-not-allowed nt:disabled:opacity-50',\n\t\t\t\t\t\tclassName\n\t\t\t\t\t)}\n\t\t\t\t\tdata-slot=\"command-input\"\n\t\t\t\t\t{...props}\n\t\t\t\t/>\n\t\t\t\t<InputGroupAddon>\n\t\t\t\t\t<SearchIcon className=\"nt:size-4 nt:shrink-0 nt:opacity-50\" />\n\t\t\t\t</InputGroupAddon>\n\t\t\t</InputGroup>\n\t\t</div>\n\t);\n}\n\nfunction CommandList({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.List>) {\n\treturn (\n\t\t<CommandPrimitive.List\n\t\t\tclassName={cn(\n\t\t\t\t'nt:no-scrollbar nt:max-h-72 nt:scroll-py-1 nt:overflow-x-hidden nt:overflow-y-auto nt:outline-none',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-slot=\"command-list\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandEmpty({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Empty>) {\n\treturn (\n\t\t<CommandPrimitive.Empty\n\t\t\tclassName={cn('nt:py-6 nt:text-center nt:text-sm', className)}\n\t\t\tdata-slot=\"command-empty\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandGroup({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Group>) {\n\treturn (\n\t\t<CommandPrimitive.Group\n\t\t\tclassName={cn(\n\t\t\t\t'nt:overflow-hidden nt:p-1 nt:text-foreground nt:**:[[cmdk-group-heading]]:px-2 nt:**:[[cmdk-group-heading]]:py-1.5 nt:**:[[cmdk-group-heading]]:text-xs nt:**:[[cmdk-group-heading]]:font-medium nt:**:[[cmdk-group-heading]]:text-muted-foreground',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-slot=\"command-group\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandSeparator({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Separator>) {\n\treturn (\n\t\t<CommandPrimitive.Separator\n\t\t\tclassName={cn('nt:-mx-1 nt:h-px nt:bg-border', className)}\n\t\t\tdata-slot=\"command-separator\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandItem({\n\tclassName,\n\tchildren,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Item>) {\n\treturn (\n\t\t<CommandPrimitive.Item\n\t\t\tclassName={cn(\n\t\t\t\t'nt:group/command-item nt:relative nt:flex nt:cursor-default nt:items-center nt:gap-2 nt:rounded-sm nt:px-2 nt:py-1.5 nt:text-sm nt:outline-hidden nt:select-none nt:in-data-[slot=dialog-content]:rounded-lg! nt:data-[disabled=true]:pointer-events-none nt:data-[disabled=true]:opacity-50 nt:data-selected:bg-muted nt:data-selected:text-foreground nt:[&_svg]:pointer-events-none nt:[&_svg]:shrink-0 nt:[&_svg:not([class*=size-])]:size-4 nt:data-selected:*:[svg]:text-foreground',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-slot=\"command-item\"\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t\t<CheckIcon className=\"nt:ml-auto nt:opacity-0 nt:group-has-data-[slot=command-shortcut]/command-item:hidden nt:group-data-[checked=true]/command-item:opacity-100\" />\n\t\t</CommandPrimitive.Item>\n\t);\n}\n\nfunction CommandShortcut({\n\tclassName,\n\t...props\n}: React.ComponentProps<'span'>) {\n\treturn (\n\t\t<span\n\t\t\tclassName={cn(\n\t\t\t\t'nt:ml-auto nt:text-xs nt:tracking-widest nt:text-muted-foreground nt:group-data-selected/command-item:text-foreground',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-slot=\"command-shortcut\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tCommand,\n\tCommandDialog,\n\tCommandInput,\n\tCommandList,\n\tCommandEmpty,\n\tCommandGroup,\n\tCommandItem,\n\tCommandShortcut,\n\tCommandSeparator\n};\n"],"mappings":";AAqBE,cA0BC,YA1BD;AAnBF,SAAS,WAAW,wBAAwB;AAC5C,SAAS,YAAY,iBAAiB;AAGtC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,YAAY,uBAAuB;AAC5C,SAAS,UAAU;AAEnB,SAAS,QAAQ;AAAA,EAChB;AAAA,EACA,GAAG;AACJ,GAAkD;AACjD,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAW;AAAA,QACV;AAAA,QACA;AAAA,MACD;AAAA,MACA,aAAU;AAAA,MACT,GAAG;AAAA;AAAA,EACL;AAEF;AAEA,SAAS,cAAc;AAAA,EACtB,QAAQ;AAAA,EACR,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA,kBAAkB;AAAA,EAClB,GAAG;AACJ,GAKG;AACF,SACC,qBAAC,UAAQ,GAAG,OACX;AAAA,yBAAC,gBAAa,WAAU,cACvB;AAAA,0BAAC,eAAa,iBAAM;AAAA,MACpB,oBAAC,qBAAmB,uBAAY;AAAA,OACjC;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA,WAAW;AAAA,UACV;AAAA,UACA;AAAA,QACD;AAAA,QACA;AAAA,QAEC;AAAA;AAAA,IACF;AAAA,KACD;AAEF;AAEA,SAAS,aAAa;AAAA,EACrB;AAAA,EACA,GAAG;AACJ,GAAwD;AACvD,SACC,oBAAC,SAAI,WAAU,kBAAiB,aAAU,yBACzC,+BAAC,cAAW,WAAU,qHACrB;AAAA;AAAA,MAAC,iBAAiB;AAAA,MAAjB;AAAA,QACA,WAAW;AAAA,UACV;AAAA,UACA;AAAA,QACD;AAAA,QACA,aAAU;AAAA,QACT,GAAG;AAAA;AAAA,IACL;AAAA,IACA,oBAAC,mBACA,8BAAC,cAAW,WAAU,uCAAsC,GAC7D;AAAA,KACD,GACD;AAEF;AAEA,SAAS,YAAY;AAAA,EACpB;AAAA,EACA,GAAG;AACJ,GAAuD;AACtD,SACC;AAAA,IAAC,iBAAiB;AAAA,IAAjB;AAAA,MACA,WAAW;AAAA,QACV;AAAA,QACA;AAAA,MACD;AAAA,MACA,aAAU;AAAA,MACT,GAAG;AAAA;AAAA,EACL;AAEF;AAEA,SAAS,aAAa;AAAA,EACrB;AAAA,EACA,GAAG;AACJ,GAAwD;AACvD,SACC;AAAA,IAAC,iBAAiB;AAAA,IAAjB;AAAA,MACA,WAAW,GAAG,qCAAqC,SAAS;AAAA,MAC5D,aAAU;AAAA,MACT,GAAG;AAAA;AAAA,EACL;AAEF;AAEA,SAAS,aAAa;AAAA,EACrB;AAAA,EACA,GAAG;AACJ,GAAwD;AACvD,SACC;AAAA,IAAC,iBAAiB;AAAA,IAAjB;AAAA,MACA,WAAW;AAAA,QACV;AAAA,QACA;AAAA,MACD;AAAA,MACA,aAAU;AAAA,MACT,GAAG;AAAA;AAAA,EACL;AAEF;AAEA,SAAS,iBAAiB;AAAA,EACzB;AAAA,EACA,GAAG;AACJ,GAA4D;AAC3D,SACC;AAAA,IAAC,iBAAiB;AAAA,IAAjB;AAAA,MACA,WAAW,GAAG,iCAAiC,SAAS;AAAA,MACxD,aAAU;AAAA,MACT,GAAG;AAAA;AAAA,EACL;AAEF;AAEA,SAAS,YAAY;AAAA,EACpB;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAAuD;AACtD,SACC;AAAA,IAAC,iBAAiB;AAAA,IAAjB;AAAA,MACA,WAAW;AAAA,QACV;AAAA,QACA;AAAA,MACD;AAAA,MACA,aAAU;AAAA,MACT,GAAG;AAAA,MAEH;AAAA;AAAA,QACD,oBAAC,aAAU,WAAU,+IAA8I;AAAA;AAAA;AAAA,EACpK;AAEF;AAEA,SAAS,gBAAgB;AAAA,EACxB;AAAA,EACA,GAAG;AACJ,GAAiC;AAChC,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAW;AAAA,QACV;AAAA,QACA;AAAA,MACD;AAAA,MACA,aAAU;AAAA,MACT,GAAG;AAAA;AAAA,EACL;AAEF;","names":[]}
|