UNPKG

@sikka/hawa

Version:

Modern UI Kit made with Tailwind

283 lines (279 loc) • 11.2 kB
"use client"; "use strict"; var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // layout/appMenubar/index.ts var appMenubar_exports = {}; __export(appMenubar_exports, { Menubar: () => Menubar, MenubarCheckboxItem: () => MenubarCheckboxItem, MenubarContent: () => MenubarContent, MenubarGroup: () => MenubarGroup, MenubarItem: () => MenubarItem, MenubarLabel: () => MenubarLabel, MenubarMenu: () => MenubarMenu, MenubarPortal: () => MenubarPortal, MenubarRadioGroup: () => MenubarRadioGroup, MenubarRadioItem: () => MenubarRadioItem, MenubarSeparator: () => MenubarSeparator, MenubarShortcut: () => MenubarShortcut, MenubarSub: () => MenubarSub, MenubarSubContent: () => MenubarSubContent, MenubarSubTrigger: () => MenubarSubTrigger, MenubarTrigger: () => MenubarTrigger }); module.exports = __toCommonJS(appMenubar_exports); // layout/appMenubar/AppMenubar.tsx var React = __toESM(require("react")); var MenubarPrimitive = __toESM(require("@radix-ui/react-menubar")); // util/index.ts var import_clsx = require("clsx"); var import_tailwind_merge = require("tailwind-merge"); function cn(...inputs) { return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs)); } // layout/appMenubar/AppMenubar.tsx var MenubarMenu = MenubarPrimitive.Menu; var MenubarGroup = MenubarPrimitive.Group; var MenubarPortal = MenubarPrimitive.Portal; var MenubarSub = MenubarPrimitive.Sub; var MenubarRadioGroup = MenubarPrimitive.RadioGroup; var Menubar = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement( MenubarPrimitive.Root, { ref, className: cn( "hawa-flex hawa-h-10 hawa-items-center hawa-space-x-1 hawa-rounded-md hawa-border hawa-bg-background hawa-p-1", className ), ...props } )); Menubar.displayName = MenubarPrimitive.Root.displayName; var MenubarTrigger = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement( MenubarPrimitive.Trigger, { ref, className: cn( "hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-font-medium hawa-outline-none focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-accent-foreground", className ), ...props } )); MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName; var MenubarSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ React.createElement( MenubarPrimitive.SubTrigger, { ref, className: cn( "hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-px-2 hawa-py-1.5 hawa-text-sm hawa-outline-none focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-accent-foreground", inset && "pl-8", className ), ...props }, children, /* @__PURE__ */ React.createElement( "svg", { "aria-label": "Chevron Right Icon", xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "hawa-icon hawa-ml-auto" }, /* @__PURE__ */ React.createElement("path", { d: "m9 18 6-6-6-6" }) ) )); MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName; var MenubarSubContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement( MenubarPrimitive.SubContent, { ref, className: cn( "hawa-z-50 hawa-min-w-[8rem] hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-p-1 hawa-text-popover-foreground data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2", className ), ...props } )); MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName; var MenubarContent = React.forwardRef( ({ className, align = "start", alignOffset = -4, sideOffset = 8, ...props }, ref) => /* @__PURE__ */ React.createElement(MenubarPrimitive.Portal, null, /* @__PURE__ */ React.createElement( MenubarPrimitive.Content, { ref, align, alignOffset, sideOffset, className: cn( "hawa-z-50 hawa-min-w-[12rem] hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-p-1 hawa-text-popover-foreground hawa-shadow-md data-[state=open]:hawa-animate-in data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2", className ), ...props } )) ); MenubarContent.displayName = MenubarPrimitive.Content.displayName; var MenubarItem = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ React.createElement( MenubarPrimitive.Item, { ref, className: cn( "hawa-relative hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-px-2 hawa-py-1.5 hawa-text-sm hawa-outline-none focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50", inset && "pl-8", className ), ...props } )); MenubarItem.displayName = MenubarPrimitive.Item.displayName; var MenubarCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ React.createElement( MenubarPrimitive.CheckboxItem, { ref, className: cn( "hawa-relative hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-py-1.5 hawa-pl-8 hawa-pr-2 hawa-text-sm hawa-outline-none focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50", className ), checked, ...props }, /* @__PURE__ */ React.createElement("span", { className: "hawa-absolute hawa-left-2 hawa-flex hawa-h-3.5 hawa-w-3.5 hawa-items-center hawa-justify-center" }, /* @__PURE__ */ React.createElement(MenubarPrimitive.ItemIndicator, null, /* @__PURE__ */ React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "hawa-icon" }, /* @__PURE__ */ React.createElement("path", { d: "M20 6 9 17l-5-5" }) ))), children )); MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName; var MenubarRadioItem = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React.createElement( MenubarPrimitive.RadioItem, { ref, className: cn( "hawa-relative hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-py-1.5 hawa-pl-8 hawa-pr-2 hawa-text-sm hawa-outline-none focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50", className ), ...props }, /* @__PURE__ */ React.createElement("span", { className: "hawa-absolute hawa-left-2 hawa-flex hawa-h-3.5 hawa-w-3.5 hawa-items-center hawa-justify-center" }, /* @__PURE__ */ React.createElement(MenubarPrimitive.ItemIndicator, null, /* @__PURE__ */ React.createElement( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "hawa-h-2 hawa-w-2 hawa-fill-current" }, /* @__PURE__ */ React.createElement("circle", { cx: "12", cy: "12", r: "10" }) ))), children )); MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName; var MenubarLabel = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ React.createElement( MenubarPrimitive.Label, { ref, className: cn( "hawa-px-2 hawa-py-1.5 hawa-text-sm hawa-font-semibold", inset && "hawa-pl-8", className ), ...props } )); MenubarLabel.displayName = MenubarPrimitive.Label.displayName; var MenubarSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement( MenubarPrimitive.Separator, { ref, className: cn("hawa--mx-1 hawa-my-1 hawa-h-px hawa-bg-muted", className), ...props } )); MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName; var MenubarShortcut = ({ className, ...props }) => { return /* @__PURE__ */ React.createElement( "span", { className: cn( "hawa-ml-auto hawa-text-xs hawa-tracking-widest hawa-text-muted-foreground", className ), ...props } ); }; MenubarShortcut.displayname = "MenubarShortcut"; // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger }); //# sourceMappingURL=index.js.map