UNPKG

@vela-ui/react

Version:

Vela UI React components

3 lines (2 loc) 1.89 kB
"use client" import{a as i}from"./chunk-F2WO2AUP.mjs";import{ListBoxItem as l,Text as p,Collection as u,composeRenderProps as a,Header as x,ListBoxSection as f,Separator as P}from"react-aria-components";import{twMerge as c}from"tailwind-merge";import{tv as D}from"tailwind-variants";import{Fragment as w,jsx as o,jsxs as d}from"react/jsx-runtime";var v=D({base:"relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[selection-mode]:pr-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",variants:{variant:{default:"",destructive:"text-destructive *:[svg]:!text-destructive"},isFocused:{true:"bg-accent text-accent-foreground"},isHovered:{true:"bg-accent text-accent-foreground"},isDisabled:{true:"pointer-events-none opacity-50"}},compoundVariants:[{variant:"destructive",isFocused:!0,className:"bg-destructive/10 dark:bg-destructive/20 text-destructive"}]});function T({className:t,...e}){return d(f,{className:t,children:["title"in e&&o(x,{className:"text-muted-foreground px-2 py-1.5 text-xs",children:e.title}),o(u,{items:e.items,children:e.children})]})}function L({className:t,variant:e,...r}){let m=r.textValue||(typeof r.children=="string"?r.children:void 0);return o(l,{textValue:m,className:a(t,(n,s)=>v({...s,variant:e,className:n})),...r,children:a(r.children,(n,{isSelected:s})=>d(w,{children:[s&&o("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center",children:o(i,{})}),n]}))})}function h({className:t,...e}){return o(p,{slot:"label",className:t,...e})}function N({className:t,...e}){return o(p,{slot:"description",className:c("text-muted-foreground text-sm",t),...e})}function V({className:t,...e}){return o(P,{orientation:"horizontal",className:c("bg-border -mx-1 my-1 h-px",t),...e})}export{v as a,T as b,L as c,h as d,N as e,V as f};