UNPKG

@szum-tech/design-system

Version:

Szum-Tech design system with tailwindcss support

1 lines 4.52 kB
import {a}from'./chunk-JUNHRB4B.js';import {ChevronDownIcon,ChevronUpIcon,CheckIcon}from'lucide-react';import {Select}from'radix-ui';import {jsxs,jsx}from'react/jsx-runtime';function K({children:e,disabled:t,defaultOpen:a$1,defaultValue:n,value:c,dir:u,open:v,form:S,name:g,onOpenChange:P,onValueChange:x,required:b,autoComplete:y,placeholder:h,className:w,size:C="default",invalid:R=false,...d}){let I={children:e,disabled:t,defaultOpen:a$1,defaultValue:n,value:c,dir:u,open:v,form:S,name:g,onOpenChange:P,onValueChange:x,required:b,autoComplete:y};return jsxs(Select.Root,{"data-slot":"select",...I,children:[jsxs(Select.Trigger,{"data-slot":"select-trigger","aria-invalid":d["aria-invalid"]||R?true:void 0,"data-size":C,className:a("border-input dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none","*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2","disabled:cursor-not-allowed disabled:opacity-50","aria-invalid:ring-error/20 dark:aria-invalid:ring-error/40 aria-invalid:border-error","data-[size=default]:h-8 data-[size=sm]:h-7","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","[&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","data-[placeholder]:text-muted-foreground",w),...d,children:[jsx(Select.Value,{"data-slot":"select-value",placeholder:h}),jsx(Select.Icon,{asChild:true,children:jsx(ChevronDownIcon,{className:"size-4 opacity-50"})})]}),e]})}function Y({className:e,children:t,position:a$1="popper",align:n="center",...c}){return jsx(Select.Portal,{children:jsxs(Select.Content,{"data-slot":"select-content",className:a("bg-popover text-popover-foreground border-border relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded border shadow-sm","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-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",a$1==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:a$1,align:n,...c,children:[jsx(_,{}),jsx(Select.Viewport,{className:a("p-1",a$1==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),jsx(k,{})]})})}function _({className:e,...t}){return jsx(Select.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:a("flex cursor-default items-center justify-center py-1",e),...t,children:jsx(ChevronUpIcon,{className:"size-4"})})}function k({className:e,...t}){return jsx(Select.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:a("flex cursor-default items-center justify-center py-1",e),...t,children:jsx(ChevronDownIcon,{className:"size-4"})})}function ee(e){return jsx(Select.Group,{"data-slot":"select-group",...e})}function le({className:e,children:t,...a$1}){return jsxs(Select.Item,{"data-slot":"select-item",className:a("focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","[&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...a$1,children:[jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:jsx(Select.ItemIndicator,{children:jsx(CheckIcon,{className:"size-4"})})}),jsx(Select.ItemText,{children:t})]})}function me({className:e,...t}){return jsx(Select.Label,{"data-slot":"select-label",className:a("text-muted-foreground px-2 py-1.5 text-xs",e),...t})}function Se({className:e,...t}){return jsx(Select.Separator,{"data-slot":"select-separator",className:a("bg-border pointer-events-none -mx-1 my-1 h-px",e),...t})}export{K as a,Y as b,ee as c,le as d,me as e,Se as f};