@loke/design-system
Version:
A design system with individually importable components
2 lines (1 loc) • 4.46 kB
JavaScript
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 __reExport=(target,mod,secondTarget)=>{var keys=__getOwnPropNames(mod);for(let key of keys)if(!__hasOwnProp.call(target,key)&&key!=="default")__defProp(target,key,{get:__accessProp.bind(mod,key),enumerable:!0});if(secondTarget){for(let key of keys)if(!__hasOwnProp.call(secondTarget,key)&&key!=="default")__defProp(secondTarget,key,{get:__accessProp.bind(mod,key),enumerable:!0});return secondTarget}},__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_button={};__export(exports_button,{buttonVariants:()=>buttonVariants,Button:()=>Button});module.exports=__toCommonJS(exports_button);var import_cn=require("@loke/design-system/cn"),import_slot=require("@loke/ui/slot"),import_class_variance_authority=require("class-variance-authority"),import_react=require("react"),jsx_runtime=require("react/jsx-runtime"),buttonVariants=import_class_variance_authority.cva(import_cn.cn("inline-flex items-center justify-center shrink-0 whitespace-nowrap rounded-lg border border-transparent bg-clip-padding text-sm font-medium outline-none transition-all select-none group/button","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3","aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:ring-3","dark:aria-invalid:ring-destructive/40 dark:aria-invalid:border-destructive/50","disabled:pointer-events-none disabled:opacity-50","[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"),{defaultVariants:{justify:"center",size:"default",variant:"default"},variants:{justify:{between:"justify-between",center:"justify-center",end:"justify-end",start:"justify-start"},size:{default:"h-10 px-4 py-2",icon:"size-8","icon-lg":"size-9","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",lg:"h-11 rounded-md px-8",sm:"h-9 rounded-md px-3"},variant:{default:"bg-primary text-primary-foreground hover:bg-brand-900 dark:hover:bg-brand-100",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-accent hover:text-accent-foreground aria-expanded:bg-accent aria-expanded:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground aria-expanded:bg-muted aria-expanded:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/60 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground"},width:{fit:"w-fit",full:"w-full"}}}),ButtonSlot=import_slot.createSlot("Button"),Button=import_react.forwardRef(({className,variant,size,width,justify,asChild=!1,...props},ref)=>{return jsx_runtime.jsx(asChild?ButtonSlot:"button",{className:import_cn.cn(buttonVariants({className,justify,size,variant,width})),ref,...props})});