@vela-ui/react
Version:
Vela UI React components
3 lines (2 loc) • 3.17 kB
JavaScript
"use client"
;"use client";var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var B=Object.prototype.hasOwnProperty;var T=(e,t)=>{for(var n in t)a(e,n,{get:t[n],enumerable:!0})},h=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of y(t))!B.call(e,s)&&s!==n&&a(e,s,{get:()=>t[s],enumerable:!(i=b(t,s))||i.enumerable});return e};var I=e=>h(a({},"__esModule",{value:!0}),e);var z={};T(z,{ListBox:()=>V,ListBoxDescription:()=>R,ListBoxItem:()=>N,ListBoxLabel:()=>A,ListBoxSection:()=>k});module.exports=I(z);var D=require("react-aria-components");var S=require("clsx"),d=require("react-aria-components"),m=require("tailwind-merge");function l(e,t){return(0,d.composeRenderProps)(e,n=>(0,m.twMerge)(t,n))}var o=require("react-aria-components"),u=require("tailwind-merge"),f=require("tailwind-variants");var c=require("react/jsx-runtime"),x=e=>(0,c.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,c.jsx)("path",{d:"M20 6 9 17l-5-5"})});var r=require("react/jsx-runtime"),C=(0,f.tv)({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 w({className:e,...t}){return(0,r.jsxs)(o.ListBoxSection,{className:e,children:["title"in t&&(0,r.jsx)(o.Header,{className:"text-muted-foreground px-2 py-1.5 text-xs",children:t.title}),(0,r.jsx)(o.Collection,{items:t.items,children:t.children})]})}function g({className:e,variant:t,...n}){let i=n.textValue||(typeof n.children=="string"?n.children:void 0);return(0,r.jsx)(o.ListBoxItem,{textValue:i,className:(0,o.composeRenderProps)(e,(s,p)=>C({...p,variant:t,className:s})),...n,children:(0,o.composeRenderProps)(n.children,(s,{isSelected:p})=>(0,r.jsxs)(r.Fragment,{children:[p&&(0,r.jsx)("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center",children:(0,r.jsx)(x,{})}),s]}))})}function P({className:e,...t}){return(0,r.jsx)(o.Text,{slot:"label",className:e,...t})}function v({className:e,...t}){return(0,r.jsx)(o.Text,{slot:"description",className:(0,u.twMerge)("text-muted-foreground text-sm",e),...t})}var L=require("react/jsx-runtime");function V({className:e,...t}){return(0,L.jsx)(D.ListBox,{className:l(e,"group bg-popover text-popover-foreground min-w-[8rem] overflow-auto rounded-md border p-1 shadow-md outline-hidden data-[empty]:p-6 data-[empty]:text-center data-[empty]:text-sm"),...t})}var N=g,k=w,A=P,R=v;0&&(module.exports={ListBox,ListBoxDescription,ListBoxItem,ListBoxLabel,ListBoxSection});