@szum-tech/design-system
Version:
Szum-Tech design system with tailwindcss support
1 lines • 5.89 kB
JavaScript
import {c,a as a$1,d,b}from'./chunk-NY7ACKFG.js';import {a as a$2}from'./chunk-M7WD2A7J.js';import {a}from'./chunk-JUNHRB4B.js';import*as P from'react';import {Combobox}from'@base-ui/react';import {jsx,jsxs}from'react/jsx-runtime';import {ChevronDownIcon,XIcon,CheckIcon}from'lucide-react';var ro=Combobox.Root;function eo(){return P.useRef(null)}function po({...o}){return jsx(Combobox.Value,{"data-slot":"combobox-value",...o})}function g({className:o,children:r,...e}){return jsxs(Combobox.Trigger,{"data-slot":"combobox-trigger",className:a("[&_svg:not([class*='size-'])]:size-4",o),...e,children:[r,jsx(ChevronDownIcon,{className:"text-muted-foreground pointer-events-none size-4"})]})}function h({className:o,...r}){return jsx(Combobox.Clear,{"data-slot":"combobox-clear",render:jsx(c,{variant:"ghost",size:"icon-xs"}),className:a(o),...r,children:jsx(XIcon,{className:"pointer-events-none"})})}function Go({className:o,children:r,disabled:e=false,showTrigger:i=true,showClear:b$1=false,...p}){return jsxs(a$1,{className:a("w-auto",o),children:[jsx(Combobox.Input,{render:jsx(d,{disabled:e}),...p}),jsxs(b,{align:"inline-end",children:[i&&jsx(c,{size:"icon-xs",variant:"ghost",asChild:true,"data-slot":"input-group-button",className:"group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent",disabled:e,children:jsx(g,{})}),b$1&&jsx(h,{disabled:e})]}),r]})}function ko({className:o,side:r="bottom",sideOffset:e=6,align:i="start",alignOffset:b=0,anchor:p,...w}){return jsx(Combobox.Portal,{children:jsx(Combobox.Positioner,{side:r,sideOffset:e,align:i,alignOffset:b,anchor:p,className:"isolate z-50",children:jsx(Combobox.Popup,{"data-slot":"combobox-content","data-chips":!!p,className:a("group/combobox-content bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded shadow-md ring-1 duration-100 data-[chips=true]:min-w-(--anchor-width) *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:shadow-none",o),...w})})})}function Oo({className:o,...r}){return jsx(Combobox.List,{"data-slot":"combobox-list",className:a("no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0",o),...r})}function Mo({className:o,children:r,...e}){return jsxs(Combobox.Item,{"data-slot":"combobox-item",className:a("data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground relative flex w-full cursor-default items-center gap-2 rounded py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),...e,children:[r,jsx(Combobox.ItemIndicator,{render:jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center"}),children:jsx(CheckIcon,{className:"pointer-events-none"})})]})}function Ko({className:o,...r}){return jsx(Combobox.Group,{"data-slot":"combobox-group",className:a(o),...r})}function $o({className:o,...r}){return jsx(Combobox.GroupLabel,{"data-slot":"combobox-label",className:a("text-muted-foreground px-2 py-1.5 text-xs",o),...r})}function rt({...o}){return jsx(Combobox.Collection,{"data-slot":"combobox-collection",...o})}function at({className:o,...r}){return jsx(Combobox.Empty,{"data-slot":"combobox-empty",className:a("text-muted-foreground hidden w-full justify-center py-2 text-center text-sm group-data-empty/combobox-content:flex",o),...r})}function lt({className:o,...r}){return jsx(Combobox.Separator,{"data-slot":"combobox-separator",className:a("bg-border -mx-1 my-1 h-px",o),...r})}function ft({className:o,...r}){return jsx(Combobox.Chips,{"data-slot":"combobox-chips",className:a("border-input focus-within:border-ring focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-destructive/20 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40 flex min-h-8 flex-wrap items-center gap-1 rounded border bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors focus-within:ring-3 has-aria-invalid:ring-3 has-data-[slot=combobox-chip]:px-1",o),...r})}function wt({className:o,children:r,showRemove:e=true,...i}){return jsxs(Combobox.Chip,{"data-slot":"combobox-chip",className:a("bg-muted text-foreground flex h-[calc(--spacing(5.25))] w-fit items-center justify-center gap-1 rounded px-1.5 text-xs font-medium whitespace-nowrap has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0",o),...i,children:[r,e&&jsx(Combobox.ChipRemove,{render:jsx(a$2,{variant:"ghost",size:"icon-xs"}),className:"-ml-1 opacity-50 hover:opacity-100","data-slot":"combobox-chip-remove",children:jsx(XIcon,{className:"pointer-events-none"})})]})}function Lt({className:o,...r}){return jsx(Combobox.Input,{"data-slot":"combobox-chip-input",className:a("min-w-16 flex-1 outline-none",o),...r})}export{ro as a,eo as b,po as c,g as d,h as e,Go as f,ko as g,Oo as h,Mo as i,Ko as j,$o as k,rt as l,at as m,lt as n,ft as o,wt as p,Lt as q};