UNPKG

daily-toolset

Version:

A lightweight, versatile collection of TypeScript utility functions for everyday development needs. Simplify and streamline your Node.js, React, and Next.js projects with a powerful suite of well-organized helpers for strings, arrays, dates, objects, and

64 lines (63 loc) 4.38 kB
"use strict"; "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 (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __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 jsx_runtime_1 = require("react/jsx-runtime"); 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) => ((0, jsx_runtime_1.jsx)(cmdk_1.Command, { ref: ref, className: `flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground ${className}`, ...props }))); exports.Command = Command; Command.displayName = cmdk_1.Command.displayName; const CommandDialog = ({ children, ...props }) => { return ((0, jsx_runtime_1.jsx)(dialog_1.Dialog, { ...props, children: (0, jsx_runtime_1.jsx)(dialog_1.DialogContent, { className: "explita-command-dialog", children: (0, jsx_runtime_1.jsx)(Command, { className: "explita-command", children: children }) }) })); }; exports.CommandDialog = CommandDialog; const CommandInput = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsxs)("div", { className: "explita-command-input-wrapper", "cmdk-input-wrapper": "", children: [(0, jsx_runtime_1.jsx)(lu_1.LuSearch, {}), (0, jsx_runtime_1.jsx)(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) => ((0, jsx_runtime_1.jsx)(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) => ((0, jsx_runtime_1.jsx)(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) => ((0, jsx_runtime_1.jsx)(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) => ((0, jsx_runtime_1.jsx)(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) => ((0, jsx_runtime_1.jsx)(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 ((0, jsx_runtime_1.jsx)("span", { className: `explita-command-shortcut ${className}`, ...props })); }; exports.CommandShortcut = CommandShortcut; CommandShortcut.displayName = "CommandShortcut";