UNPKG

@vela-ui/react

Version:

Vela UI React components

3 lines (2 loc) 6.15 kB
"use client" "use strict";"use client";var g=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var L=(e,r)=>{for(var s in r)g(e,s,{get:r[s],enumerable:!0})},N=(e,r,s,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of V(r))!C.call(e,o)&&o!==s&&g(e,o,{get:()=>r[o],enumerable:!(a=R(r,o))||a.enumerable});return e};var B=e=>N(g({},"__esModule",{value:!0}),e);var O={};L(O,{Button:()=>E,buttonVariants:()=>k});module.exports=B(O);var d=require("react-aria-components"),w=require("tailwind-variants");var m=require("tailwind-variants"),x=(0,m.tv)({base:"outline-hidden",variants:{isFocusVisible:{true:"border-ring ring-ring/50 ring-[3px]"},isInvalid:{true:"ring-destructive/20 dark:ring-destructive/40 border-destructive"}}});var b=require("tailwind-variants");var u=require("react/jsx-runtime"),v=e=>(0,u.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"1em",height:"1em",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,u.jsx)("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})});var p=require("react/jsx-runtime"),y=e=>(0,p.jsxs)("svg",{fill:"none",width:"1em",height:"1em",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,p.jsx)("path",{stroke:"currentColor",strokeOpacity:"0.25",strokeWidth:"3.636",d:"M11.909 21a9.09 9.09 0 1 0 0-18.182 9.09 9.09 0 0 0 0 18.182Z"}),(0,p.jsx)("path",{fill:"currentColor",d:"M4.636 11.91a7.273 7.273 0 0 1 7.273-7.274V1C5.885 1 1 5.885 1 11.91zm1.819 4.81a7.24 7.24 0 0 1-1.819-4.81H1c0 2.764 1.032 5.294 2.727 7.215z"})]});var f=require("clsx"),T=require("react-aria-components"),h=require("tailwind-merge"),l=(...e)=>(0,h.twMerge)((0,f.clsx)(...e));var t=require("react/jsx-runtime"),A=(0,b.tv)({base:"relative",variants:{size:{xs:"size-3",sm:"size-4",md:"size-5",lg:"size-8",xl:"size-10"}},defaultVariants:{size:"md"}});function _({className:e,...r}){return(0,t.jsx)(v,{className:l("size-4 animate-spin",e),"data-slot":"icon",...r})}var I=({className:e,...r})=>(0,t.jsx)(y,{className:l("size-4 animate-spin",e),"data-slot":"icon",...r});function M({className:e,...r}){return(0,t.jsx)("svg",{className:l("size-4 stroke-current",e),"data-slot":"icon",viewBox:"0 0 2400 2400",...r,children:(0,t.jsxs)("g",{strokeWidth:"200",strokeLinecap:"round",fill:"none",children:[(0,t.jsx)("line",{x1:"1200",y1:"600",x2:"1200",y2:"100"}),(0,t.jsx)("line",{opacity:"0.5",x1:"1200",y1:"2300",x2:"1200",y2:"1800"}),(0,t.jsx)("line",{opacity:"0.917",x1:"900",y1:"680.4",x2:"650",y2:"247.4"}),(0,t.jsx)("line",{opacity:"0.417",x1:"1750",y1:"2152.6",x2:"1500",y2:"1719.6"}),(0,t.jsx)("line",{opacity:"0.833",x1:"680.4",y1:"900",x2:"247.4",y2:"650"}),(0,t.jsx)("line",{opacity:"0.333",x1:"2152.6",y1:"1750",x2:"1719.6",y2:"1500"}),(0,t.jsx)("line",{opacity:"0.75",x1:"600",y1:"1200",x2:"100",y2:"1200"}),(0,t.jsx)("line",{opacity:"0.25",x1:"2300",y1:"1200",x2:"1800",y2:"1200"}),(0,t.jsx)("line",{opacity:"0.667",x1:"680.4",y1:"1500",x2:"247.4",y2:"1750"}),(0,t.jsx)("line",{opacity:"0.167",x1:"2152.6",y1:"650",x2:"1719.6",y2:"900"}),(0,t.jsx)("line",{opacity:"0.583",x1:"900",y1:"1719.6",x2:"650",y2:"2152.6"}),(0,t.jsx)("line",{opacity:"0.083",x1:"1750",y1:"247.4",x2:"1500",y2:"680.4"}),(0,t.jsx)("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",keyTimes:"0;0.08333;0.16667;0.25;0.33333;0.41667;0.5;0.58333;0.66667;0.75;0.83333;0.91667",values:"0 1199 1199;30 1199 1199;60 1199 1199;90 1199 1199;120 1199 1199;150 1199 1199;180 1199 1199;210 1199 1199;240 1199 1199;270 1199 1199;300 1199 1199;330 1199 1199",dur:"0.83333s",begin:"0.08333s",repeatCount:"indefinite",calcMode:"discrete"})]})})}var D={default:_,ring:I,spin:M},S="default";function z(e){let{className:r,size:s,ref:a,variant:o,...i}=e,c=D[o!=null?o:S];return(0,t.jsx)(c,{role:"presentation",ref:a,className:A({size:s,className:r}),...i})}var n=require("react/jsx-runtime"),k=(0,w.tv)({extend:x,base:"inline-flex shrink-0 items-center justify-center rounded-md font-medium whitespace-nowrap transition-all [&_svg]:pointer-events-none [&_svg]:shrink-0",variants:{variant:{neutral:"bg-neutral text-neutral-foreground hover:bg-neutral/90 shadow-xs",primary:"bg-primary text-primary-foreground hover:bg-primary/90 shadow-xs",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-xs",accent:"bg-accent text-accent-foreground hover:bg-accent/80 shadow-xs",destructive:"bg-destructive hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white shadow-xs",outline:"bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 border shadow-xs",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{xs:"size-8 gap-1 text-xs [&_svg:not([class*='size-'])]:size-4",sm:"size-9 gap-2 text-sm [&_svg:not([class*='size-'])]:size-4",md:"size-10 gap-2 text-sm [&_svg:not([class*='size-'])]:size-5",lg:"size-11 gap-2.5 text-base [&_svg:not([class*='size-'])]:size-5",xl:"size-12 gap-2.5 text-base [&_svg:not([class*='size-'])]:size-5"},shape:{rectangle:"",square:"",circle:"rounded-full"},isDisabled:{true:"pointer-events-none opacity-50"},isPending:{true:"pointer-events-none opacity-50"}},compoundVariants:[{size:"xs",shape:"rectangle",className:"w-auto px-2.5"},{size:"sm",shape:"rectangle",className:"w-auto px-3.5"},{size:"md",shape:"rectangle",className:"w-auto px-4"},{size:"lg",shape:"rectangle",className:"w-auto px-5"},{size:"xl",shape:"rectangle",className:"w-auto px-5"}],defaultVariants:{variant:"primary",size:"md",shape:"rectangle"}});function E({className:e,variant:r,size:s,shape:a,loader:o=(0,n.jsx)(z,{}),...i}){return(0,n.jsx)(d.Button,{"data-slot":"button",className:(0,d.composeRenderProps)(e,(c,P)=>k({...P,variant:r,size:s,shape:a,className:c})),...i,children:(0,d.composeRenderProps)(i.children,c=>(0,n.jsxs)(n.Fragment,{children:[i.isPending&&o,c]}))})}0&&(module.exports={Button,buttonVariants});