@loke/design-system
Version:
A design system with individually importable components
3 lines (2 loc) • 9.2 kB
JavaScript
"use client";
var __create=Object.create;var{getPrototypeOf:__getProtoOf,defineProperty:__defProp,getOwnPropertyNames:__getOwnPropNames,getOwnPropertyDescriptor:__getOwnPropDesc}=Object,__hasOwnProp=Object.prototype.hasOwnProperty;function __accessProp(key){return this[key]}var __toESMCache_node,__toESMCache_esm,__toESM=(mod,isNodeMode,target)=>{var canCache=mod!=null&&typeof mod==="object";if(canCache){var cache=isNodeMode?__toESMCache_node??=new WeakMap:__toESMCache_esm??=new WeakMap,cached=cache.get(mod);if(cached)return cached}target=mod!=null?__create(__getProtoOf(mod)):{};let to=isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target;for(let key of __getOwnPropNames(mod))if(!__hasOwnProp.call(to,key))__defProp(to,key,{get:__accessProp.bind(mod,key),enumerable:!0});if(canCache)cache.set(mod,to);return to},__toCommonJS=(from)=>{var entry=(__moduleCache??=new WeakMap).get(from),desc;if(entry)return entry;if(entry=__defProp({},"__esModule",{value:!0}),from&&typeof from==="object"||typeof from==="function"){for(var key of __getOwnPropNames(from))if(!__hasOwnProp.call(entry,key))__defProp(entry,key,{get:__accessProp.bind(from,key),enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable})}return __moduleCache.set(from,entry),entry},__moduleCache;var __returnValue=(v)=>v;function __exportSetter(name,newValue){this[name]=__returnValue.bind(null,newValue)}var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0,configurable:!0,set:__exportSetter.bind(all,name)})};var exports_dropdown_menu={};__export(exports_dropdown_menu,{DropdownMenuTrigger:()=>DropdownMenuTrigger,DropdownMenuSubTrigger:()=>DropdownMenuSubTrigger,DropdownMenuSubContent:()=>DropdownMenuSubContent,DropdownMenuSub:()=>DropdownMenuSub,DropdownMenuShortcut:()=>DropdownMenuShortcut,DropdownMenuSeparator:()=>DropdownMenuSeparator,DropdownMenuRadioItem:()=>DropdownMenuRadioItem,DropdownMenuRadioGroup:()=>DropdownMenuRadioGroup,DropdownMenuPortal:()=>DropdownMenuPortal,DropdownMenuLabel:()=>DropdownMenuLabel,DropdownMenuItem:()=>DropdownMenuItem,DropdownMenuGroup:()=>DropdownMenuGroup,DropdownMenuContent:()=>DropdownMenuContent,DropdownMenuCheckboxItem:()=>DropdownMenuCheckboxItem,DropdownMenu:()=>DropdownMenu});module.exports=__toCommonJS(exports_dropdown_menu);var import_cn=require("@loke/design-system/cn"),import_icons=require("@loke/icons"),DropdownMenuPrimitive=__toESM(require("@loke/ui/dropdown-menu")),jsx_runtime=require("react/jsx-runtime");function DropdownMenu({...props}){return jsx_runtime.jsx(DropdownMenuPrimitive.Root,{"data-slot":"dropdown-menu",...props})}function DropdownMenuPortal({...props}){return jsx_runtime.jsx(DropdownMenuPrimitive.Portal,{"data-slot":"dropdown-menu-portal",...props})}function DropdownMenuTrigger({...props}){return jsx_runtime.jsx(DropdownMenuPrimitive.Trigger,{"data-slot":"dropdown-menu-trigger",...props})}function DropdownMenuContent({className,align="start",sideOffset=4,matchTriggerWidth,...props}){return jsx_runtime.jsx(DropdownMenuPrimitive.Portal,{children:jsx_runtime.jsx(DropdownMenuPrimitive.Content,{align,className:import_cn.cn("data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--loke-dropdown-menu-content-available-height) w-(--loke-dropdown-menu-trigger-width) min-w-32 origin-(--loke-dropdown-menu-content-transform-origin) overflow-y-auto overflow-x-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-closed:animate-out data-open:animate-in data-[state=closed]:overflow-hidden",{"max-h-(--loke-dropdown-menu-content-available-height) w-(--loke-dropdown-menu-trigger-width)":matchTriggerWidth},className),"data-slot":"dropdown-menu-content",sideOffset,...props})})}function DropdownMenuGroup({...props}){return jsx_runtime.jsx(DropdownMenuPrimitive.Group,{"data-slot":"dropdown-menu-group",...props})}function DropdownMenuItem({className,inset,variant="default",...props}){return jsx_runtime.jsx(DropdownMenuPrimitive.Item,{className:import_cn.cn("group/dropdown-menu-item relative flex cursor-default select-none items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-inset:pl-7 data-[variant=destructive]:text-destructive data-disabled:opacity-50 data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0 data-[variant=destructive]:*:[svg]:text-destructive",className),"data-inset":inset,"data-slot":"dropdown-menu-item","data-variant":variant,...props})}function DropdownMenuCheckboxItem({className,children,checked,inset,...props}){return jsx_runtime.jsxs(DropdownMenuPrimitive.CheckboxItem,{checked,className:import_cn.cn("relative flex cursor-default select-none items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-disabled:pointer-events-none data-inset:pl-7 data-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",className),"data-inset":inset,"data-slot":"dropdown-menu-checkbox-item",...props,children:[jsx_runtime.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-checkbox-item-indicator",children:jsx_runtime.jsx(DropdownMenuPrimitive.ItemIndicator,{children:jsx_runtime.jsx(import_icons.CheckIcon,{})})}),children]})}function DropdownMenuRadioGroup({...props}){return jsx_runtime.jsx(DropdownMenuPrimitive.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...props})}function DropdownMenuRadioItem({className,children,inset,...props}){return jsx_runtime.jsxs(DropdownMenuPrimitive.RadioItem,{className:import_cn.cn("relative flex cursor-default select-none items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-disabled:pointer-events-none data-inset:pl-7 data-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",className),"data-inset":inset,"data-slot":"dropdown-menu-radio-item",...props,children:[jsx_runtime.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-radio-item-indicator",children:jsx_runtime.jsx(DropdownMenuPrimitive.ItemIndicator,{children:jsx_runtime.jsx(import_icons.CheckIcon,{})})}),children]})}function DropdownMenuLabel({className,inset,...props}){return jsx_runtime.jsx(DropdownMenuPrimitive.Label,{className:import_cn.cn("px-1.5 py-1 font-medium text-muted-foreground text-xs data-inset:pl-7",className),"data-inset":inset,"data-slot":"dropdown-menu-label",...props})}function DropdownMenuSeparator({className,...props}){return jsx_runtime.jsx(DropdownMenuPrimitive.Separator,{className:import_cn.cn("-mx-1 my-1 h-px bg-border",className),"data-slot":"dropdown-menu-separator",...props})}function DropdownMenuShortcut({className,...props}){return jsx_runtime.jsx("span",{className:import_cn.cn("ml-auto text-muted-foreground text-xs tracking-widest group-focus/dropdown-menu-item:text-accent-foreground",className),"data-slot":"dropdown-menu-shortcut",...props})}function DropdownMenuSub({...props}){return jsx_runtime.jsx(DropdownMenuPrimitive.Sub,{"data-slot":"dropdown-menu-sub",...props})}function DropdownMenuSubTrigger({className,inset,children,...props}){return jsx_runtime.jsxs(DropdownMenuPrimitive.SubTrigger,{className:import_cn.cn("flex cursor-default select-none items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-open:bg-accent data-inset:pl-7 data-open:text-accent-foreground [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",className),"data-inset":inset,"data-slot":"dropdown-menu-sub-trigger",...props,children:[children,jsx_runtime.jsx(import_icons.ChevronRightIcon,{className:"cn-rtl-flip ml-auto"})]})}function DropdownMenuSubContent({className,...props}){return jsx_runtime.jsx(DropdownMenuPrimitive.SubContent,{className:import_cn.cn("data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-24 origin-(--loke-dropdown-menu-content-transform-origin) overflow-hidden rounded-md bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-closed:animate-out data-open:animate-in",className),"data-slot":"dropdown-menu-sub-content",...props})}