UNPKG

ivt

Version:

Ivt Components Library

3 lines (2 loc) 2.22 kB
import*as e from"react";import{c as s}from"../chunks/utils-C-nkZ_Ir.mjs";import{c as m}from"../chunks/createLucideIcon-D1jKv6AP.mjs";import{C as t,b as a,c as n,d as r,e as i,f as c}from"../chunks/command-uwBExuyh.mjs";import{C as o}from"../chunks/check-PTeDoR8O.mjs";import{P as l,a as u,b as p}from"../chunks/popover-DLVlIkos.mjs";import{B as h}from"../chunks/button-CWf6NSDH.mjs";import"../chunks/bundle-mjs-DHbvkKp4.mjs";import"../chunks/index-D1EuiH1M.mjs";import"../chunks/index-DVnblQ-a.mjs";import"../chunks/index-C-j8pU3U.mjs";import"../chunks/index-Dr5ObK3L.mjs";import"react/jsx-runtime";import"../chunks/index-UQBMY2z8.mjs";import"../chunks/index-0-u0cdz8.mjs";import"../chunks/index-BOUg6o32.mjs";import"../chunks/index-C_Mk3Jfk.mjs";import"../chunks/index-DiPp8h7C.mjs";import"react-dom";import"@radix-ui/react-slot";import"../chunks/index-DSUHCtxx.mjs";import"../chunks/index-lVEpnR8T.mjs";import"../chunks/tslib.es6-Bvey-QDo.mjs";import"../chunks/index-1xuBLrml.mjs";import"../chunks/dialog-Dxotsves.mjs";import"../chunks/x-COocN1ks.mjs";import"../chunks/index-DtZD7YmJ.mjs";import"../chunks/index-CnLJ482V.mjs";import"class-variance-authority";const d=m("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);function k({items:m,value:k,onValueChange:j,placeholder:x="Select item...",searchPlaceholder:f="Search item...",emptyMessage:E="No item found.",widthClassName:v="w-fit",className:g,groupHeading:b}){const[y,w]=e.useState(!1),N=e=>{j(e===k?"":e),w(!1)};return e.createElement(l,{open:y,onOpenChange:w},e.createElement(u,{asChild:!0},e.createElement(h,{variant:"outline","aria-expanded":y,className:s(v,"justify-between",g)},k?m.find(e=>e.value===k)?.label:x,e.createElement(d,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"}))),e.createElement(p,{className:s(v,"p-0")},e.createElement(t,null,e.createElement(a,{placeholder:f,className:"h-9"}),e.createElement(n,null,e.createElement(r,null,E),e.createElement(i,{heading:b},m.map(m=>e.createElement(c,{key:m.value,value:m.value,onSelect:N},m.label,e.createElement(o,{className:s("ml-auto h-4 w-4",k===m.value?"opacity-100":"opacity-0")}))))))))}export{k as Combobox}; //# sourceMappingURL=index.mjs.map