@explita/daily-toolset-components
Version:
A lightweight and versatile collection of TypeScript utility functions and form components, inspired by ShadCN UI, designed for seamless everyday development. Enhance your Node.js, React, and Next.js projects with a well-structured suite of helpers for st
76 lines (75 loc) • 4.57 kB
JavaScript
"use client";
;
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.CommandSeparator = exports.CommandShortcut = exports.CommandItem = exports.CommandGroup = exports.CommandEmpty = exports.CommandList = exports.CommandInput = exports.CommandDialog = exports.Command = void 0;
const React = __importStar(require("react"));
const cmdk_1 = require("cmdk");
const lu_1 = require("react-icons/lu");
const dialog_1 = require("./dialog");
const Command = React.forwardRef(({ className, ...props }, ref) => (React.createElement(cmdk_1.Command, { ref: ref, className: `explita-command ${className || ""}`, ...props })));
exports.Command = Command;
Command.displayName = cmdk_1.Command.displayName;
const CommandDialog = ({ children, ...props }) => {
return (React.createElement(dialog_1.Dialog, { ...props },
React.createElement(dialog_1.DialogContent, { className: "explita-command-dialog" },
React.createElement(Command, { className: "explita-command" }, children))));
};
exports.CommandDialog = CommandDialog;
const CommandInput = React.forwardRef(({ className, ...props }, ref) => (React.createElement("div", { className: "explita-command-input-wrapper", "cmdk-input-wrapper": "" },
React.createElement(lu_1.LuSearch, null),
React.createElement(cmdk_1.Command.Input, { ref: ref, className: `input ${className || ""}`, ...props }))));
exports.CommandInput = CommandInput;
CommandInput.displayName = cmdk_1.Command.Input.displayName;
const CommandList = React.forwardRef(({ className, ...props }, ref) => (React.createElement(cmdk_1.Command.List, { ref: ref, className: `explita-command-list ${className || ""}`, ...props })));
exports.CommandList = CommandList;
CommandList.displayName = cmdk_1.Command.List.displayName;
const CommandEmpty = React.forwardRef((props, ref) => (React.createElement(cmdk_1.Command.Empty, { ref: ref, className: "explita-command-empty", ...props })));
exports.CommandEmpty = CommandEmpty;
CommandEmpty.displayName = cmdk_1.Command.Empty.displayName;
const CommandGroup = React.forwardRef(({ className, ...props }, ref) => (React.createElement(cmdk_1.Command.Group, { ref: ref, className: `explita-command-group ${className || ""}`, ...props })));
exports.CommandGroup = CommandGroup;
CommandGroup.displayName = cmdk_1.Command.Group.displayName;
const CommandSeparator = React.forwardRef(({ className, ...props }, ref) => (React.createElement(cmdk_1.Command.Separator, { ref: ref, className: `explita-command-separator ${className || ""}`, ...props })));
exports.CommandSeparator = CommandSeparator;
CommandSeparator.displayName = cmdk_1.Command.Separator.displayName;
const CommandItem = React.forwardRef(({ className, ...props }, ref) => (React.createElement(cmdk_1.Command.Item, { ref: ref, className: `explita-command-item ${className || ""}`, ...props })));
exports.CommandItem = CommandItem;
CommandItem.displayName = cmdk_1.Command.Item.displayName;
const CommandShortcut = ({ className, ...props }) => {
return (React.createElement("span", { className: `explita-command-shortcut ${className || ""}`, ...props }));
};
exports.CommandShortcut = CommandShortcut;
CommandShortcut.displayName = "CommandShortcut";