UNPKG

@vela-ui/react

Version:

Vela UI React components

3 lines (2 loc) 1.2 kB
"use client" import{a as i}from"./chunk-66S7FQOQ.mjs";import{a}from"./chunk-F2WO2AUP.mjs";import{a as t}from"./chunk-KCI5SKSW.mjs";import{Checkbox as u,composeRenderProps as c}from"react-aria-components";import{tv as n}from"tailwind-variants";import{Fragment as f,jsx as r,jsxs as g}from"react/jsx-runtime";var h=n({base:"group relative flex items-center gap-2 text-sm transition",variants:{isDisabled:{true:"cursor-not-allowed opacity-50"}}}),k=n({extend:t,base:"peer border-input dark:bg-input/30 flex shrink-0 items-center justify-center rounded-[4px] border shadow-xs transition-shadow [&_svg]:size-full",variants:{size:{sm:"size-4",md:"size-5 p-0.5",lg:"size-6 p-0.5"},isSelected:{true:"bg-primary dark:bg-primary text-primary-foreground border-primary"},isDisabled:{true:"cursor-not-allowed opacity-50"}},defaultVariants:{size:"md"}});function V({className:p,children:d,indicatorClassName:m,size:l,...b}){return r(u,{className:c(p,(o,e)=>h({...e,className:o})),...b,children:c(d,(o,{isSelected:e,isIndeterminate:s,...x})=>g(f,{children:[r("div",{"data-slot":"checkbox-indicator",className:k({isSelected:e||s,size:l,...x,className:m}),children:s?r(i,{}):e?r(a,{}):null}),o]}))})}export{V as a};